Re: Maven plugins, Java 9, and split packages
On 2017-10-20T14:43:52 +0200 "Robert Scholte"wrote: > > > This looks to be a case of split packages amongst all of the various > > Maven artifacts. I'm adding dependency exclusions to try to work around > > the issues, but I'm not confident that'll actually work. > > > > Are there efforts underway to clean this stuff up? > > No, Maven has its own modular system long before the Java Platform Modular > System (JPMS)... OK, makes sense. I was seeing errors related to Class.byName in some of the exceptions I was seeing, so I mistakenly assumed that there was some degree of modularization underway that possibly wasn't quite complete yet. I suspect the actual problems I'm seeing here are just out-of-date dependencies. > > The reason I'm modularizing the plugin is due to this: > > > > "To build and run japicmp under Java 1.9, you must add the following > > module: java.xml.bind. This can be done for the maven plugin for example > > by: > > > > export MAVEN_OPTS="--add-modules java.xml.bind" > > IIUC this doesn't mean you have to introduce a module descriptor (i.e. > module-info.java ). > > The reason is that this module is marked as deprecated and won't be > activated by the JDK/JRE by default. By adding this argument it is loaded > anyway. > > What you should try to do instead is add the following dependency: > > javax.xml.bind > jaxb-api > 2.3.0 > Noted, thanks! I'll be testing this out today. -- Mark Raynsford | http://www.io7m.com pgpm9GhabWg7Q.pgp Description: OpenPGP digital signature
Re: Maven plugins, Java 9, and split packages
This looks to be a case of split packages amongst all of the various Maven artifacts. I'm adding dependency exclusions to try to work around the issues, but I'm not confident that'll actually work. Are there efforts underway to clean this stuff up? No, Maven has its own modular system long before the Java Platform Modular System (JPMS). Due to the evolution of Maven over the last decade there are indeed split packages, which was never an issue. Cleaning up is simply not possible and not necessary, unless we make a monolith of it, which is actually the opposite of want you want to achieve with modularization. Cleaning up would mean introducing new packages, which would effectively make all current maven-plugins useless. For that reason I see no reason to make it JPMS-modular. The reason I'm modularizing the plugin is due to this: "To build and run japicmp under Java 1.9, you must add the following module: java.xml.bind. This can be done for the maven plugin for example by: export MAVEN_OPTS="--add-modules java.xml.bind" IIUC this doesn't mean you have to introduce a module descriptor (i.e. module-info.java ). The reason is that this module is marked as deprecated and won't be activated by the JDK/JRE by default. By adding this argument it is loaded anyway. What you should try to do instead is add the following dependency: javax.xml.bind jaxb-api 2.3.0 thanks, Robert I'd rather not have to do this as I'm committed to having all of my project builds run without needing extra Maven flags: "mvn clean install" *must* just work on every system, no exceptions. Am I undertaking a fool's errand trying to get this stuff to work cleanly? If not, is there any documentation on modularizing existing plugins? [0] https://github.com/siom79/japicmp/ - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
Maven plugins, Java 9, and split packages
Hello. I'm experimenting with modularizing an existing plugin (japicmp [0]) and am running into hundreds of errors of the form: [ERROR] the unnamed module reads package org.apache.maven.plugin from both maven.plugin.api and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.resolver from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.resolver.filter from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.repository from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.repository.metadata from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.repository.layout from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.metadata from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.handler from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.handler.manager from both maven.artifact and maven.core [ERROR] the unnamed module reads package org.apache.maven.artifact.factory from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.plugin from both maven.plugin.api and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.resolver from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.resolver.filter from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.repository from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.repository.metadata from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.repository.layout from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.metadata from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.handler from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.handler.manager from both maven.artifact and maven.core [ERROR] module maven.plugin.annotations reads package org.apache.maven.artifact.factory from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.plugin from both maven.plugin.api and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.resolver from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.resolver.filter from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.repository from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.repository.metadata from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.repository.layout from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.metadata from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.handler from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.handler.manager from both maven.artifact and maven.core [ERROR] module maven.plugin.api reads package org.apache.maven.artifact.factory from both maven.artifact and maven.core [ERROR] module maven.artifact reads package org.apache.maven.plugin from both maven.plugin.api and maven.core [ERROR] module maven.artifact reads package org.apache.maven.artifact from both maven.artifact and maven.core [ERROR] module maven.artifact reads package org.apache.maven.artifact.resolver from both maven.artifact and maven.core [ERROR] module maven.artifact reads package org.apache.maven.artifact.resolver.filter from both maven.artifact and maven.core [ERROR] module maven.artifact reads package org.apache.maven.artifact.repository from both maven.artifact and maven.core [ERROR] module maven.artifact reads package org.apache.maven.artifact.repository.metadata from both maven.artifact and maven.core [ERROR] module