[jira] [Commented] (MCOMPILER-337) Using old-style Jar files with Java9 Module project, Classpath and Module-path are mixed up!
[ https://issues.apache.org/jira/browse/MCOMPILER-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16437278#comment-16437278 ] Robert Scholte commented on MCOMPILER-337: -- Yes, both classpath and modulepath are use, but none of the jars are on both! {noformat} [DEBUG] Classpath: [DEBUG] E:\java-workspace\sandbox\quebec.lachine\target\classes [DEBUG] d:\maven_repo\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar [DEBUG] d:\maven_repo\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar [DEBUG] Modulepath: [DEBUG] d:\maven_repo\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar [DEBUG] d:\maven_repo\.m2\repository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar [DEBUG] d:\maven_repo\.m2\repository\org\apache\commons\commons-lang3\3.7\commons-lang3-3.7.jar {noformat} bq. the Java documentation says that the jar dependencies should be in the module-path ONLY, not both Show me, you must have interpreted it incorrectly. > Using old-style Jar files with Java9 Module project, Classpath and > Module-path are mixed up! > > > Key: MCOMPILER-337 > URL: https://issues.apache.org/jira/browse/MCOMPILER-337 > Project: Maven Compiler Plugin > Issue Type: Bug >Affects Versions: 3.7.0 >Reporter: Colbert Philippe >Assignee: Robert Scholte >Priority: Major > Attachments: quebec.lachine.zip > > > I'm trying to use Eclipse (4.8M4) with Maven to practice Java9 module. > I already contacted Maven to ask what version of Maven to use with Java 9 > module feature. They recommended the latest version: Maven 3.5.0 (latest) > with the Maven plug-in: maven-compiler-plugin 3.7.0, which is what I'm using. > I'm also using Java JDK 9. > I want to report a problem with Maven when working with Java 9 module > feature. It's not a big problem but it's big enough to prevent the use of > Maven with Java 9 modules. The problem is with Maven, when used under > Eclipse. I create Maven projects under Eclipse for speed. > I created two identical projects with Java 9 module. The two projects make > use of a few old-style Jar files by importing them as default module (as > prescribed by the makers of Java 9). The jar files are: ant.jar, > commons-beanutils-1.9.3.jar, commons-collections4-4.1.jar, > commons-lang3-3.7.jar. > * The first project is a small project built from the command-line with a > text-editor. It's a Java 9 module project (has a module-info.java) and makes > use of these 4 libray jar files in the manner prescribed by the Java 9 > documentation. This project compiles and works. All Jar files are put the the > module-path of the project and their respective 'requires' statement is in > the module-info.java file. (see below) > > {code:java} > module canada.ontario { > exports canada.ontario; > requires org.apache.commons.lang3; > requires commons.collections4; > requires commons.beanutils; > } > {code} > * > ** The second project is identical to the first one but is built using Maven > (versions specified above) created under Eclipse. The project as created as > intended based on Maven guidelines. First a parent project was created with > packaging set with pom. The a child-project was created for the module. > After the child-project was created, in the child-project POM file, I entered > the full plug-in entries to use the new 'maven-compiler-plugin' version > 3.7.0. This works because we can see its use on the compiling log display > messages. > On Eclipse Workspace view, I selected the parent project root (previously > created), right clicking on the parent project, then selecting 'Maven', then > selecting 'New Maven Module Project'. This creates a Maven child project for > the new module. > - I created a 'module-info.java' with the name of the module > (canada.ontario) in the src directory. > - I also created a package with the same name as the module (canada.ontario). > - I entered the same 'exports' and 'requires' statements as displayed above. > - I also entered all the Maven dependencies to each of the four (4) > libraries stated above. I got these dependencies from the Maven repository. > - I also enabled full compile-time log-message diplay, in order to get > maximum information. > HERE IS THE PROBLEM WHEN COMPILING THIS SECOND MAVEN CHILD-PROJECT! > When compiling the second child-project for the module, there is an error. I > have narrowed down the reason for the error. > For some unknown reason, the Maven compiler plug-in DOES NOT put all the jar > dependencies under the module-path. It splits the list of dependencies > between the classpath and the module-path, WHICH IS
[jira] [Commented] (MCOMPILER-337) Using old-style Jar files with Java9 Module project, Classpath and Module-path are mixed up!
[ https://issues.apache.org/jira/browse/MCOMPILER-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16437203#comment-16437203 ] Colbert Philippe commented on MCOMPILER-337: Robert, did you notice that using your maven-compiler-plugin declaration, the compiler puts the list of jar dependencies in BOTH the classpath and the module-path? You can view this in the detailed compiler logs. I just want to say that the Java documentation says that the jar dependencies should be in the module-path ONLY, not both. It still works but this is something to look into. Colbert > Using old-style Jar files with Java9 Module project, Classpath and > Module-path are mixed up! > > > Key: MCOMPILER-337 > URL: https://issues.apache.org/jira/browse/MCOMPILER-337 > Project: Maven Compiler Plugin > Issue Type: Bug >Affects Versions: 3.7.0 >Reporter: Colbert Philippe >Priority: Major > Attachments: quebec.lachine.zip > > > I'm trying to use Eclipse (4.8M4) with Maven to practice Java9 module. > I already contacted Maven to ask what version of Maven to use with Java 9 > module feature. They recommended the latest version: Maven 3.5.0 (latest) > with the Maven plug-in: maven-compiler-plugin 3.7.0, which is what I'm using. > I'm also using Java JDK 9. > I want to report a problem with Maven when working with Java 9 module > feature. It's not a big problem but it's big enough to prevent the use of > Maven with Java 9 modules. The problem is with Maven, when used under > Eclipse. I create Maven projects under Eclipse for speed. > I created two identical projects with Java 9 module. The two projects make > use of a few old-style Jar files by importing them as default module (as > prescribed by the makers of Java 9). The jar files are: ant.jar, > commons-beanutils-1.9.3.jar, commons-collections4-4.1.jar, > commons-lang3-3.7.jar. > * The first project is a small project built from the command-line with a > text-editor. It's a Java 9 module project (has a module-info.java) and makes > use of these 4 libray jar files in the manner prescribed by the Java 9 > documentation. This project compiles and works. All Jar files are put the the > module-path of the project and their respective 'requires' statement is in > the module-info.java file. (see below) > > {code:java} > module canada.ontario { > exports canada.ontario; > requires org.apache.commons.lang3; > requires commons.collections4; > requires commons.beanutils; > } > {code} > * > ** The second project is identical to the first one but is built using Maven > (versions specified above) created under Eclipse. The project as created as > intended based on Maven guidelines. First a parent project was created with > packaging set with pom. The a child-project was created for the module. > After the child-project was created, in the child-project POM file, I entered > the full plug-in entries to use the new 'maven-compiler-plugin' version > 3.7.0. This works because we can see its use on the compiling log display > messages. > On Eclipse Workspace view, I selected the parent project root (previously > created), right clicking on the parent project, then selecting 'Maven', then > selecting 'New Maven Module Project'. This creates a Maven child project for > the new module. > - I created a 'module-info.java' with the name of the module > (canada.ontario) in the src directory. > - I also created a package with the same name as the module (canada.ontario). > - I entered the same 'exports' and 'requires' statements as displayed above. > - I also entered all the Maven dependencies to each of the four (4) > libraries stated above. I got these dependencies from the Maven repository. > - I also enabled full compile-time log-message diplay, in order to get > maximum information. > HERE IS THE PROBLEM WHEN COMPILING THIS SECOND MAVEN CHILD-PROJECT! > When compiling the second child-project for the module, there is an error. I > have narrowed down the reason for the error. > For some unknown reason, the Maven compiler plug-in DOES NOT put all the jar > dependencies under the module-path. It splits the list of dependencies > between the classpath and the module-path, WHICH IS WRONG! (see below) > {noformat} > [INFO] Changes detected - recompiling the module! > [DEBUG] Classpath: <- There should be no jar under this Classpath list > *** > [DEBUG] C:\Users\Colbert > Philippe\workspace\montreal\quebec.lachine\target\classes > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar > [DEBUG]
[jira] [Commented] (MCOMPILER-337) Using old-style Jar files with Java9 Module project, Classpath and Module-path are mixed up!
[ https://issues.apache.org/jira/browse/MCOMPILER-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16437202#comment-16437202 ] Colbert Philippe commented on MCOMPILER-337: Robert, it finally works! The reason my build was failing is because I was using the maven java compiler declaration from this page [https://maven.apache.org/plugins/maven-compiler-plugin/examples/module-info.html] By replacing it with your simplified declaration, it works! I am very pleased because my company project can move forward. Thank-You! Colbert > Using old-style Jar files with Java9 Module project, Classpath and > Module-path are mixed up! > > > Key: MCOMPILER-337 > URL: https://issues.apache.org/jira/browse/MCOMPILER-337 > Project: Maven Compiler Plugin > Issue Type: Bug >Affects Versions: 3.7.0 >Reporter: Colbert Philippe >Priority: Major > Attachments: quebec.lachine.zip > > > I'm trying to use Eclipse (4.8M4) with Maven to practice Java9 module. > I already contacted Maven to ask what version of Maven to use with Java 9 > module feature. They recommended the latest version: Maven 3.5.0 (latest) > with the Maven plug-in: maven-compiler-plugin 3.7.0, which is what I'm using. > I'm also using Java JDK 9. > I want to report a problem with Maven when working with Java 9 module > feature. It's not a big problem but it's big enough to prevent the use of > Maven with Java 9 modules. The problem is with Maven, when used under > Eclipse. I create Maven projects under Eclipse for speed. > I created two identical projects with Java 9 module. The two projects make > use of a few old-style Jar files by importing them as default module (as > prescribed by the makers of Java 9). The jar files are: ant.jar, > commons-beanutils-1.9.3.jar, commons-collections4-4.1.jar, > commons-lang3-3.7.jar. > * The first project is a small project built from the command-line with a > text-editor. It's a Java 9 module project (has a module-info.java) and makes > use of these 4 libray jar files in the manner prescribed by the Java 9 > documentation. This project compiles and works. All Jar files are put the the > module-path of the project and their respective 'requires' statement is in > the module-info.java file. (see below) > > {code:java} > module canada.ontario { > exports canada.ontario; > requires org.apache.commons.lang3; > requires commons.collections4; > requires commons.beanutils; > } > {code} > * > ** The second project is identical to the first one but is built using Maven > (versions specified above) created under Eclipse. The project as created as > intended based on Maven guidelines. First a parent project was created with > packaging set with pom. The a child-project was created for the module. > After the child-project was created, in the child-project POM file, I entered > the full plug-in entries to use the new 'maven-compiler-plugin' version > 3.7.0. This works because we can see its use on the compiling log display > messages. > On Eclipse Workspace view, I selected the parent project root (previously > created), right clicking on the parent project, then selecting 'Maven', then > selecting 'New Maven Module Project'. This creates a Maven child project for > the new module. > - I created a 'module-info.java' with the name of the module > (canada.ontario) in the src directory. > - I also created a package with the same name as the module (canada.ontario). > - I entered the same 'exports' and 'requires' statements as displayed above. > - I also entered all the Maven dependencies to each of the four (4) > libraries stated above. I got these dependencies from the Maven repository. > - I also enabled full compile-time log-message diplay, in order to get > maximum information. > HERE IS THE PROBLEM WHEN COMPILING THIS SECOND MAVEN CHILD-PROJECT! > When compiling the second child-project for the module, there is an error. I > have narrowed down the reason for the error. > For some unknown reason, the Maven compiler plug-in DOES NOT put all the jar > dependencies under the module-path. It splits the list of dependencies > between the classpath and the module-path, WHICH IS WRONG! (see below) > {noformat} > [INFO] Changes detected - recompiling the module! > [DEBUG] Classpath: <- There should be no jar under this Classpath list > *** > [DEBUG] C:\Users\Colbert > Philippe\workspace\montreal\quebec.lachine\target\classes > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar > [DEBUG] C:\Users\Colbert >
[jira] [Commented] (MCOMPILER-337) Using old-style Jar files with Java9 Module project, Classpath and Module-path are mixed up!
[ https://issues.apache.org/jira/browse/MCOMPILER-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436982#comment-16436982 ] Robert Scholte commented on MCOMPILER-337: -- Have a look at my zip, it works as expected. > Using old-style Jar files with Java9 Module project, Classpath and > Module-path are mixed up! > > > Key: MCOMPILER-337 > URL: https://issues.apache.org/jira/browse/MCOMPILER-337 > Project: Maven Compiler Plugin > Issue Type: Bug >Affects Versions: 3.7.0 >Reporter: Colbert Philippe >Priority: Major > Attachments: quebec.lachine.zip > > > I'm trying to use Eclipse (4.8M4) with Maven to practice Java9 module. > I already contacted Maven to ask what version of Maven to use with Java 9 > module feature. They recommended the latest version: Maven 3.5.0 (latest) > with the Maven plug-in: maven-compiler-plugin 3.7.0, which is what I'm using. > I'm also using Java JDK 9. > I want to report a problem with Maven when working with Java 9 module > feature. It's not a big problem but it's big enough to prevent the use of > Maven with Java 9 modules. The problem is with Maven, when used under > Eclipse. I create Maven projects under Eclipse for speed. > I created two identical projects with Java 9 module. The two projects make > use of a few old-style Jar files by importing them as default module (as > prescribed by the makers of Java 9). The jar files are: ant.jar, > commons-beanutils-1.9.3.jar, commons-collections4-4.1.jar, > commons-lang3-3.7.jar. > * The first project is a small project built from the command-line with a > text-editor. It's a Java 9 module project (has a module-info.java) and makes > use of these 4 libray jar files in the manner prescribed by the Java 9 > documentation. This project compiles and works. All Jar files are put the the > module-path of the project and their respective 'requires' statement is in > the module-info.java file. (see below) > > {code:java} > module canada.ontario { > exports canada.ontario; > requires org.apache.commons.lang3; > requires commons.collections4; > requires commons.beanutils; > } > {code} > * > ** The second project is identical to the first one but is built using Maven > (versions specified above) created under Eclipse. The project as created as > intended based on Maven guidelines. First a parent project was created with > packaging set with pom. The a child-project was created for the module. > After the child-project was created, in the child-project POM file, I entered > the full plug-in entries to use the new 'maven-compiler-plugin' version > 3.7.0. This works because we can see its use on the compiling log display > messages. > On Eclipse Workspace view, I selected the parent project root (previously > created), right clicking on the parent project, then selecting 'Maven', then > selecting 'New Maven Module Project'. This creates a Maven child project for > the new module. > - I created a 'module-info.java' with the name of the module > (canada.ontario) in the src directory. > - I also created a package with the same name as the module (canada.ontario). > - I entered the same 'exports' and 'requires' statements as displayed above. > - I also entered all the Maven dependencies to each of the four (4) > libraries stated above. I got these dependencies from the Maven repository. > - I also enabled full compile-time log-message diplay, in order to get > maximum information. > HERE IS THE PROBLEM WHEN COMPILING THIS SECOND MAVEN CHILD-PROJECT! > When compiling the second child-project for the module, there is an error. I > have narrowed down the reason for the error. > For some unknown reason, the Maven compiler plug-in DOES NOT put all the jar > dependencies under the module-path. It splits the list of dependencies > between the classpath and the module-path, WHICH IS WRONG! (see below) > {noformat} > [INFO] Changes detected - recompiling the module! > [DEBUG] Classpath: <- There should be no jar under this Classpath list > *** > [DEBUG] C:\Users\Colbert > Philippe\workspace\montreal\quebec.lachine\target\classes > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar > [DEBUG] Modulepath: <- All jar file dependencies should be under this > ModulePath list *** > [DEBUG] C:\Users\Colbert >
[jira] [Commented] (MCOMPILER-337) Using old-style Jar files with Java9 Module project, Classpath and Module-path are mixed up!
[ https://issues.apache.org/jira/browse/MCOMPILER-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436100#comment-16436100 ] Colbert Philippe commented on MCOMPILER-337: Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T14:49:05-05:00) Maven home: C:\Users\Colbert Philippe\workspace\montreal\quebec.lachine\EMBEDDED Java version: 9, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk-9 Default locale: en_US, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows" [DEBUG] Created new class realm maven.api [DEBUG] Importing foreign packages into class realm maven.api [DEBUG] Imported: javax.annotation.* < plexus.core [DEBUG] Imported: javax.annotation.security.* < plexus.core [DEBUG] Imported: javax.enterprise.inject.* < plexus.core [DEBUG] Imported: javax.enterprise.util.* < plexus.core [DEBUG] Imported: javax.inject.* < plexus.core [DEBUG] Imported: org.apache.maven.* < plexus.core [DEBUG] Imported: org.apache.maven.artifact < plexus.core [DEBUG] Imported: org.apache.maven.classrealm < plexus.core [DEBUG] Imported: org.apache.maven.cli < plexus.core [DEBUG] Imported: org.apache.maven.configuration < plexus.core [DEBUG] Imported: org.apache.maven.exception < plexus.core [DEBUG] Imported: org.apache.maven.execution < plexus.core [DEBUG] Imported: org.apache.maven.execution.scope < plexus.core [DEBUG] Imported: org.apache.maven.lifecycle < plexus.core [DEBUG] Imported: org.apache.maven.model < plexus.core [DEBUG] Imported: org.apache.maven.monitor < plexus.core [DEBUG] Imported: org.apache.maven.plugin < plexus.core [DEBUG] Imported: org.apache.maven.profiles < plexus.core [DEBUG] Imported: org.apache.maven.project < plexus.core [DEBUG] Imported: org.apache.maven.reporting < plexus.core [DEBUG] Imported: org.apache.maven.repository < plexus.core [DEBUG] Imported: org.apache.maven.rtinfo < plexus.core [DEBUG] Imported: org.apache.maven.settings < plexus.core [DEBUG] Imported: org.apache.maven.toolchain < plexus.core [DEBUG] Imported: org.apache.maven.usability < plexus.core [DEBUG] Imported: org.apache.maven.wagon.* < plexus.core [DEBUG] Imported: org.apache.maven.wagon.authentication < plexus.core [DEBUG] Imported: org.apache.maven.wagon.authorization < plexus.core [DEBUG] Imported: org.apache.maven.wagon.events < plexus.core [DEBUG] Imported: org.apache.maven.wagon.observers < plexus.core [DEBUG] Imported: org.apache.maven.wagon.proxy < plexus.core [DEBUG] Imported: org.apache.maven.wagon.repository < plexus.core [DEBUG] Imported: org.apache.maven.wagon.resource < plexus.core [DEBUG] Imported: org.codehaus.classworlds < plexus.core [DEBUG] Imported: org.codehaus.plexus.* < plexus.core [DEBUG] Imported: org.codehaus.plexus.classworlds < plexus.core [DEBUG] Imported: org.codehaus.plexus.component < plexus.core [DEBUG] Imported: org.codehaus.plexus.configuration < plexus.core [DEBUG] Imported: org.codehaus.plexus.container < plexus.core [DEBUG] Imported: org.codehaus.plexus.context < plexus.core [DEBUG] Imported: org.codehaus.plexus.lifecycle < plexus.core [DEBUG] Imported: org.codehaus.plexus.logging < plexus.core [DEBUG] Imported: org.codehaus.plexus.personality < plexus.core [DEBUG] Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core [DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core [DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core [DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core [DEBUG] Imported: org.eclipse.aether.* < plexus.core [DEBUG] Imported: org.eclipse.aether.artifact < plexus.core [DEBUG] Imported: org.eclipse.aether.collection < plexus.core [DEBUG] Imported: org.eclipse.aether.deployment < plexus.core [DEBUG] Imported: org.eclipse.aether.graph < plexus.core [DEBUG] Imported: org.eclipse.aether.impl < plexus.core [DEBUG] Imported: org.eclipse.aether.installation < plexus.core [DEBUG] Imported: org.eclipse.aether.internal.impl < plexus.core [DEBUG] Imported: org.eclipse.aether.metadata < plexus.core [DEBUG] Imported: org.eclipse.aether.repository < plexus.core [DEBUG] Imported: org.eclipse.aether.resolution < plexus.core [DEBUG] Imported: org.eclipse.aether.spi < plexus.core [DEBUG] Imported: org.eclipse.aether.transfer < plexus.core [DEBUG] Imported: org.eclipse.aether.version < plexus.core [DEBUG] Imported: org.fusesource.jansi.* < plexus.core [DEBUG] Imported: org.slf4j.* < plexus.core [DEBUG] Imported: org.slf4j.helpers.* < plexus.core [DEBUG] Imported: org.slf4j.spi.* < plexus.core [DEBUG] Populating class realm maven.api [INFO] Error stacktraces are turned on. [DEBUG] Message scheme: plain [DEBUG] Reading global settings from settings.xml [DEBUG] Reading user settings from C:\Users\Colbert
[jira] [Commented] (MCOMPILER-337) Using old-style Jar files with Java9 Module project, Classpath and Module-path are mixed up!
[ https://issues.apache.org/jira/browse/MCOMPILER-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436083#comment-16436083 ] Colbert Philippe commented on MCOMPILER-337: Hi Robert! Robert, I used Eclipse to create the entire project structure. I didn't hand-code it! It take too long my hand. I prefer to do it through Eclipse. My version of Eclipse is the most recent one for Java9. It's Eclipse 4.8M. There is another version: Eclipse 4.8M a for Java10. I think both are very similar. Here is how I created the project under Eclipse using Maven. * I create a new simple Java project using Maven. I make sure that it's package is POM. That's my parent project. * Within my parent project (right-click on parent), go down the menu to Maven->Create New Maven Module, which creates a new child-project for a module. * The module-info is not in the child-project (it should since I selected 'Create new Maven Module'). Eclipse should be doing this automatically. * I am forced to create my own module-info.java. I do this using Eclipse menu option. Right-click child-project->Configure->Create module-info * I am also forced to create the module package myself. Eclipse should be doing this. * I populate the module-info.java as show my original letter. If you wish, we can do a Skype conference and do a screen-share. This might save time narrowing down the problem. The bottom-line is that Maven + maven-compiler-plugin is mixing-up Classpath and module-path. That's WRONG! Only module-path should be used! > Using old-style Jar files with Java9 Module project, Classpath and > Module-path are mixed up! > > > Key: MCOMPILER-337 > URL: https://issues.apache.org/jira/browse/MCOMPILER-337 > Project: Maven Compiler Plugin > Issue Type: Bug >Affects Versions: 3.7.0 >Reporter: Colbert Philippe >Priority: Major > > I'm trying to use Eclipse (4.8M4) with Maven to practice Java9 module. > I already contacted Maven to ask what version of Maven to use with Java 9 > module feature. They recommended the latest version: Maven 3.5.0 (latest) > with the Maven plug-in: maven-compiler-plugin 3.7.0, which is what I'm using. > I'm also using Java JDK 9. > I want to report a problem with Maven when working with Java 9 module > feature. It's not a big problem but it's big enough to prevent the use of > Maven with Java 9 modules. The problem is with Maven, when used under > Eclipse. I create Maven projects under Eclipse for speed. > I created two identical projects with Java 9 module. The two projects make > use of a few old-style Jar files by importing them as default module (as > prescribed by the makers of Java 9). The jar files are: ant.jar, > commons-beanutils-1.9.3.jar, commons-collections4-4.1.jar, > commons-lang3-3.7.jar. > * The first project is a small project built from the command-line with a > text-editor. It's a Java 9 module project (has a module-info.java) and makes > use of these 4 libray jar files in the manner prescribed by the Java 9 > documentation. This project compiles and works. All Jar files are put the the > module-path of the project and their respective 'requires' statement is in > the module-info.java file. (see below) > > {code:java} > module canada.ontario { > exports canada.ontario; > requires org.apache.commons.lang3; > requires commons.collections4; > requires commons.beanutils; > } > {code} > * > ** The second project is identical to the first one but is built using Maven > (versions specified above) created under Eclipse. The project as created as > intended based on Maven guidelines. First a parent project was created with > packaging set with pom. The a child-project was created for the module. > After the child-project was created, in the child-project POM file, I entered > the full plug-in entries to use the new 'maven-compiler-plugin' version > 3.7.0. This works because we can see its use on the compiling log display > messages. > On Eclipse Workspace view, I selected the parent project root (previously > created), right clicking on the parent project, then selecting 'Maven', then > selecting 'New Maven Module Project'. This creates a Maven child project for > the new module. > - I created a 'module-info.java' with the name of the module > (canada.ontario) in the src directory. > - I also created a package with the same name as the module (canada.ontario). > - I entered the same 'exports' and 'requires' statements as displayed above. > - I also entered all the Maven dependencies to each of the four (4) > libraries stated above. I got these dependencies from the Maven repository. > - I also enabled full compile-time log-message diplay, in order to
[jira] [Commented] (MCOMPILER-337) Using old-style Jar files with Java9 Module project, Classpath and Module-path are mixed up!
[ https://issues.apache.org/jira/browse/MCOMPILER-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16435901#comment-16435901 ] Robert Scholte commented on MCOMPILER-337: -- bq. I created a 'module-info.java' with the name of the module (canada.ontario) in the src directory. This line worries me a bit, it seems that the project structure doesn't follow the [Maven standard directory layout|https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html], but more the Eclipse Java layout. Assuming you're not bound to the project structure, I'd suggest to Mavens default. If you import this in Eclipse, it'll recognize the correct structure. > Using old-style Jar files with Java9 Module project, Classpath and > Module-path are mixed up! > > > Key: MCOMPILER-337 > URL: https://issues.apache.org/jira/browse/MCOMPILER-337 > Project: Maven Compiler Plugin > Issue Type: Bug >Affects Versions: 3.7.0 >Reporter: Colbert Philippe >Priority: Major > > I'm trying to use Eclipse (4.8M4) with Maven to practice Java9 module. > I already contacted Maven to ask what version of Maven to use with Java 9 > module feature. They recommended the latest version: Maven 3.5.0 (latest) > with the Maven plug-in: maven-compiler-plugin 3.7.0, which is what I'm using. > I'm also using Java JDK 9. > I want to report a problem with Maven when working with Java 9 module > feature. It's not a big problem but it's big enough to prevent the use of > Maven with Java 9 modules. The problem is with Maven, when used under > Eclipse. I create Maven projects under Eclipse for speed. > I created two identical projects with Java 9 module. The two projects make > use of a few old-style Jar files by importing them as default module (as > prescribed by the makers of Java 9). The jar files are: ant.jar, > commons-beanutils-1.9.3.jar, commons-collections4-4.1.jar, > commons-lang3-3.7.jar. > * The first project is a small project built from the command-line with a > text-editor. It's a Java 9 module project (has a module-info.java) and makes > use of these 4 libray jar files in the manner prescribed by the Java 9 > documentation. This project compiles and works. All Jar files are put the the > module-path of the project and their respective 'requires' statement is in > the module-info.java file. (see below) > > {code:java} > module canada.ontario { > exports canada.ontario; > requires org.apache.commons.lang3; > requires commons.collections4; > requires commons.beanutils; > } > {code} > * > ** The second project is identical to the first one but is built using Maven > (versions specified above) created under Eclipse. The project as created as > intended based on Maven guidelines. First a parent project was created with > packaging set with pom. The a child-project was created for the module. > After the child-project was created, in the child-project POM file, I entered > the full plug-in entries to use the new 'maven-compiler-plugin' version > 3.7.0. This works because we can see its use on the compiling log display > messages. > On Eclipse Workspace view, I selected the parent project root (previously > created), right clicking on the parent project, then selecting 'Maven', then > selecting 'New Maven Module Project'. This creates a Maven child project for > the new module. > - I created a 'module-info.java' with the name of the module > (canada.ontario) in the src directory. > - I also created a package with the same name as the module (canada.ontario). > - I entered the same 'exports' and 'requires' statements as displayed above. > - I also entered all the Maven dependencies to each of the four (4) > libraries stated above. I got these dependencies from the Maven repository. > - I also enabled full compile-time log-message diplay, in order to get > maximum information. > HERE IS THE PROBLEM WHEN COMPILING THIS SECOND MAVEN CHILD-PROJECT! > When compiling the second child-project for the module, there is an error. I > have narrowed down the reason for the error. > For some unknown reason, the Maven compiler plug-in DOES NOT put all the jar > dependencies under the module-path. It splits the list of dependencies > between the classpath and the module-path, WHICH IS WRONG! (see below) > [INFO] Changes detected - recompiling the module! > [DEBUG] Classpath: <- There should be no jar under this Classpath list > *** > [DEBUG] C:\Users\Colbert > Philippe\workspace\montreal\quebec.lachine\target\classes > [DEBUG] C:\Users\Colbert > Philippe\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar > [DEBUG] C:\Users\Colbert >