Surok112 / robotframework-maven-plugin

Automatically exported from code.google.com/p/robotframework-maven-plugin
0 stars 0 forks source link

Test failure in libdoc test: tools.jar required #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This might be a problem for a mailing list, but at the moment we have none, so 
I post this here.
I do not understand how I can include tools.jar to the classpath when running 
the libdoc goal for Java test libraries, and the test does not find it either. 
Within a maven run, tools.jar should be on the classpath, so I do not 
understand why the error message appears.

What steps will reproduce the problem?
1. Check out
2. Run the tests

What is the expected output? What do you see instead?
Tests should pass
But the output is:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.googlecode.LibDocMojoTest
Creating documentation from Java source files requires 'tools.jar' to be in CLAS
SPATH.

Try --help for usage information.
Resource file 'src\test\java\com\googlecode\html_resource.txt' doesn't exist.
..
Results :

Failed tests:
  testShouldSucceed(com.googlecode.LibDocMojoTest)

Tests run: 4, Failures: 1, Errors: 0, Skipped: 0

What version of the product are you using? On what operating system?
1.1-SNAPSHOT

Original issue reported on code.google.com by dietrich...@gmail.com on 25 Mar 2011 at 8:43

GoogleCodeExporter commented 8 years ago
this is very tricky as each jvm distro have different location of tools.jar. 
i'll give it a look.

can you check on this though:

http://maven.apache.org/general.html#tools-jar-dependency

instead add it as a dependency to the maven plugin

Original comment by mrmall...@gmail.com on 31 Mar 2011 at 12:50

GoogleCodeExporter commented 8 years ago
That helped to solve the tools.jar issue, I added the following to the 
pom-libdoc.xml to see if it works, and the test is no longer complaining about 
a missing tools.jar. I am using an absolute path because ${java.home} did not 
work. However, there is a different issue now: libdoc.py requires a class from 
Java 6 and cannot find it since I am running with Java 5. Well that's just the 
way it is, probably we can't do anything about it. I'll try to come up with a 
test that does not document a java testlib.

<profiles>
    <profile>
        <id>default-tools.jar</id>
        <activation>
            <property>
                <name>java.vendor</name>
                <value>Sun Microsystems Inc.</value>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>com.googlecode</groupId>
                    <artifactId>robotframework-maven-plugin</artifactId>
                    <configuration>
                        <libraryOrResourceFile>src/test/java/com/googlecode/ExampleLib.java</libraryOrResourceFile>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.sun</groupId>
                            <artifactId>tools</artifactId>
                            <version>1.6</version>
                            <scope>system</scope>
                            <systemPath>C:/programme/java/jdk1.6.0_21/lib/tools.jar</systemPath>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

Original comment by dietrich...@gmail.com on 3 Apr 2011 at 5:07

GoogleCodeExporter commented 8 years ago
I have a test now that runs fine with an html resource file. I would propose to 
replace the java lib test by this one. What do you think? 

Original comment by dietrich...@gmail.com on 3 Apr 2011 at 6:20

GoogleCodeExporter commented 8 years ago
just gave you commit rights. go check it in and let's review it together.

i'll try to add something more "universal" regarding the tools.jar issue. as i 
am on a mac, this is why i don't have that problem. 

Original comment by mrmall...@gmail.com on 4 Apr 2011 at 4:31

GoogleCodeExporter commented 8 years ago
i've already checked in changes to accommodate both sun and apple jdk's. please 
see if this works for you

Original comment by mrmall...@gmail.com on 4 Apr 2011 at 7:06

GoogleCodeExporter commented 8 years ago
This appears to be solved, the issue has disappeared.

Original comment by dietrich...@gmail.com on 9 Apr 2011 at 5:17