You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andre Tadeu de Carvalho (JIRA)" <ji...@apache.org> on 2018/12/12 01:15:00 UTC

[jira] [Issue Comment Deleted] (MJMOD-20) Main class is not being set by maven-jmod-plugin

     [ https://issues.apache.org/jira/browse/MJMOD-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andre Tadeu de Carvalho updated MJMOD-20:
-----------------------------------------
    Comment: was deleted

(was: Hi,

Here is the PR: [https://github.com/apache/maven-jmod-plugin/pull/1]

 

Thanks,)

> Main class is not being set by maven-jmod-plugin
> ------------------------------------------------
>
>                 Key: MJMOD-20
>                 URL: https://issues.apache.org/jira/browse/MJMOD-20
>             Project: Maven JMod Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.0-alpha-2
>         Environment: Ubuntu Linux 18.04 LTS
> Java 11.0.1 OpenJDK
> Maven 3.6.0
>            Reporter: Andre Tadeu de Carvalho
>            Priority: Major
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Hi!,
> I have created a project in and [https://github.com/andretadeu/maven-jigsaw-examples/tree/master/multi-modules-jmod-jlink|multi-modules-jmod-jlink] and I needed to set the parameter *--main-class* in _jmod create_ command.
> Trying to add the <mainClass> tag:
>  
> {code:java}
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-jmod-plugin</artifactId>
>     <configuration>
>         <mainClass>com.andretadeu.greetings.Main</mainClass> <!-- This-->
>         <modulePath>target/jmods</modulePath>
>         <moduleVersion>${project.version}</moduleVersion>
>     </configuration>
> {code}
>  
> Maven gave the following error during the execution of *maven-jlink-plugin*:
> [ERROR] 
> [ERROR] com.andretadeu.greetings file:///home/andre/workspaces/oss/maven-jigsaw-examples/multi-modules-jmod-jlink/greetings/target/jmods/com.andretadeu.greetings.jmod
> [ERROR] com.andretadeu.world file:///home/andre/workspaces/oss/maven-jigsaw-examples/multi-modules-jmod-jlink/world/target/jmods/com.andretadeu.world.jmod
> [ERROR] java.base file:///home/andre/.sdkman/candidates/java/11.0.1-open/jmods/java.base.jmod
> [ERROR] 
> [ERROR] Providers:
> [ERROR] java.base provides java.nio.file.spi.FileSystemProvider used by java.base
> [ERROR] Error: java.lang.IllegalArgumentException: com.andretadeu.greetings doesn't contain main class & main not specified in command line
> [INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary for multi-modules-jmod-jlink 1.0-SNAPSHOT:
> [INFO] 
> [INFO] multi-modules-jmod-jlink ........................... SUCCESS [ 0.185 s]
> [INFO] com.andretadeu.world ............................... SUCCESS [ 3.974 s]
> [INFO] com.andretadeu.greetings ........................... SUCCESS [ 0.628 s]
> [INFO] greetings-jlink .................................... FAILURE [ 3.068 s]
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 8.916 s
> [INFO] Finished at: 2018-12-11T22:42:31-02:00
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-2-SNAPSHOT:jlink (default-jlink) on project greetings-jlink: 
> [ERROR] Exit code: 1
> [ERROR] Command line was: /bin/sh -c /home/andre/.sdkman/candidates/java/11.0.1-open/bin/jlink @/home/andre/workspaces/oss/maven-jigsaw-examples/multi-modules-jmod-jlink/greetings-jlink/target/jlinkArgs
> [ERROR] 
> [ERROR] 
> [ERROR] -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-jlink-plugin:3.0.0-alpha-2-SNAPSHOT:jlink (default-jlink) on project greetings-jlink: 
> Exit code: 1
> Command line was: /bin/sh -c /home/andre/.sdkman/candidates/java/11.0.1-open/bin/jlink @/home/andre/workspaces/oss/maven-jigsaw-examples/multi-modules-jmod-jlink/greetings-jlink/target/jlinkArgs
>  
> I noticed that the *--main-class* parameter was not set in **_jmodCreateArgs_:
> {code:java}
> create
> --module-version
> 1.0-SNAPSHOT
> --class-path
> /home/andre/workspaces/oss/maven-jigsaw-examples/multi-modules-jmod-jlink/greetings/target/classes
> --module-path
> "/home/andre/workspaces/oss/maven-jigsaw-examples/multi-modules-jmod-jlink/greetings/target/classes:/home/andre/.sdkman/candidates/java/11.0.1-open/jmods"
> /home/andre/workspaces/oss/maven-jigsaw-examples/multi-modules-jmod-jlink/greetings/target/jmods/com.andretadeu.greetings.jmod
> {code}
> Debugging the plugin, I have found the root cause of the problem and I will make a pull request after publishing this issue.
>  
> Thanks,
>  
> André Tadeu de Carvalho
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)