0

In a multi module project I have a dependency on ProjectB (main and test) in ProjectA's pom configured as

    <dependency>
        <groupId>com.company</groupId>
        <artifactId>ProjectB</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>com.company</groupId>
        <artifactId>ProjectB</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <type>test-jar</type>
    </dependency>

When i attempt to package the project using the webstart-maven-plugin the test-jar is excluded from the lib directory. Is there a way to include it?

The plugin logs contain this line which indicates the test-jar dependency is being skipped.

[DEBUG] artifact axis:axis-wsdl4j:jar:1.5.1:compile doesn't contain the main class: com.company.ui.ApplicationWindow
[INFO] Skipping artifact of type test-jar for lib
[DEBUG] artifact com.jgoodies:jgoodies-looks:jar:2.5.3:compile doesnt contain the main class: com.company.ui.ApplicationWindow

Thanks.

9jabounce
  • 1
  • 3
  • The coordinates you use in the _include_ tag does not seem to match the dependency, I can see a _:tests:_ which is not present in the dependency definition. – Tome Mar 18 '15 at 07:54
  • @Tome I added the _tests_ as part of the dependency definition (as classifier) but it still fails initially specified. – 9jabounce Mar 19 '15 at 05:10
  • Have a look there: http://mojo.codehaus.org/webstart/webstart-maven-plugin/jnlp-mojos-overview.html, especially that sentence about the _include_ tag : _Note that only groupId and artifactId must be specified here. because of a limitation of the Include/ExcludesArtifactFilter_ – Tome Mar 19 '15 at 08:27
  • Thanks @Tome. When I specify just the groupid and artifactid I only get the main jar and not the test. Not the result i was looking for but at least I can focus elsewhere. – 9jabounce Mar 19 '15 at 14:38
  • Try to add _compile_ to your dependency definition. I guess this might be set as _test_ somewhere in a dependencyManagement, so forcing it to _compile_ can also help – Tome Mar 19 '15 at 15:59

1 Answers1

0

After digging through the source code I have found that including the test-jar can't be included. The plugin will only include dependencies of type "jar" and "ejb-client".

In any case I have decided to fix my problem by including the test classes as a source folder in the main jar.

9jabounce
  • 1
  • 3