Re: Maven webstart plugin can't find dependencies

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Maven webstart plugin can't find dependencies

Tim Webster
Hi,

I'm trying a very simple configuration of the webstart plugin, and it can't seem to find my dependencies when <excludeTransitive> is set to false.

I get an error about not finding the main class which is definitely present in the one dependency I provide:

Caused by: org.apache.maven.plugin.MojoExecutionException: didn't find artifact with main class: aquila.administrator.desktop.Administrator. Did you specify it? 

The problem seems to be in AbstractJnlpMojo.java (line 480):

        Collection<Artifact> artifacts =
            isExcludeTransitive() ? getProject().getDependencyArtifacts() : getProject().getArtifacts();

In my case getProject().getArtifacts() returns an empty Set, and therefore no artifact to look for a main class in.

If <excludeTransitive> is set to true, then the dependencies are returned correctly, but I don't want this setting.

So..as I mentioned the main class is definitely present, and the dependency is definitely resolved.

I've searched around quite a bit, and can't find a solution...

Even if I use the POM given on the Webstart Plugin page, I get the same error....


Here's my pom.xml (with the class/artifact names made up):

<project>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>webstart1</artifactId>
    <groupId>com.timw</groupId>
    <version>1.0</version>
    <packaging>pom</packaging>  <!-- pom when your project doesn't contain sources, jar otherwise -->
    <name>Test Case for MNG-1130</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>webstart-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jnlp</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>

                    <excludeTransitive>false</excludeTransitive>
                    <libPath>lib</libPath>

                    <jnlp>
                        <outputFile>app.jnlp</outputFile>
                        <mainClass>my.main.Class</mainClass>
                    </jnlp>

                    <sign>
                        <keystore>fillme</keystore>
                        <keypass>fillme</keypass>
                        <storepass>fillme</storepass>
                        <alias>fillme</alias>
                        <verify>true</verify>
                        <keystoreConfig>
                            <delete>true</delete>
                            <gen>true</gen>
                        </keystoreConfig>
                    </sign>

                    <outputJarVersions>true</outputJarVersions>
                    <verbose>true</verbose>

                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>my.groupId</groupId>
            <artifactId>my.artifactId</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
    </dependencies>

</project>

On Tue, Mar 10, 2015 at 6:19 PM, Tim Webster <[hidden email]> wrote:
Hi,

I'm trying a very simple configuration of the webstart plugin, and it can't seem to find my dependencies when <excludeTransitive> is set to false.

I get an error about not finding the main class, which is definitely present in the one dependency I provide:

Caused by: org.apache.maven.plugin.MojoExecutionException: didn't find artifact with main class: aquila.administrator.desktop.Administrator. Did you specify it? 

The problem seems to be in AbstractJnlpMojo.java (line 480):

        Collection<Artifact> artifacts =
            isExcludeTransitive() ? getProject().getDependencyArtifacts() : getProject().getArtifacts();

In my case getProject().getArtifacts() returns an empty Set, and therefore no artifact to look for a main class in.

If <excludeTransitive> is set to true, then the dependencies are returned correctly, but I don't want this setting.

I've searched around quite a bit, and can't find a solution...

Even if I use the POM given on the Webstart Plugin page, I get the same error....


Here's my pom.xml (with the class/artifact names made up):

<project>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>webstart1</artifactId>
    <groupId>com.timw</groupId>
    <version>1.0</version>
    <packaging>pom</packaging>  <!-- pom when your project doesn't contain sources, jar otherwise -->
    <name>Test Case for MNG-1130</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>webstart-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jnlp</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>

                    <excludeTransitive>false</excludeTransitive>
                    <libPath>lib</libPath>

                    <jnlp>
                        <outputFile>app.jnlp</outputFile>
                        <mainClass>my.main.Class</mainClass>
                    </jnlp>

                    <sign>
                        <keystore>fillme</keystore>
                        <keypass>fillme</keypass>
                        <storepass>fillme</storepass>
                        <alias>fillme</alias>
                        <verify>true</verify>
                        <keystoreConfig>
                            <delete>true</delete>
                            <gen>true</gen>
                        </keystoreConfig>
                    </sign>

                    <outputJarVersions>true</outputJarVersions>
                    <verbose>true</verbose>

                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>my.groupId</groupId>
            <artifactId>my.artifactId</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
    </dependencies>

</project>

Loading...