Maven annotation processing fails with JDK9-ea+138
Christian Beikov
christian.beikov at gmail.com
Wed Oct 5 07:10:04 UTC 2016
I am using the following plugin definition:
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<compilerArguments>-J--add-modules=java.xml.bind</compilerArguments>
<!-- source output directory -->
<outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
<processors>
<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
</processors>
</configuration>
</execution>
</executions>
<dependencies>
<!-- Metamodel -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>1.3.0.Final</version>
</dependency>
</dependencies>
</plugin>
which invokes javac like this(according to the debug output)
[DEBUG] javac option: -cp
[DEBUG] javac option: ....
[DEBUG] javac option: -proc:only
[DEBUG] javac option: -J--add-modules=java.xml.bind
[DEBUG] javac option: -processor
[DEBUG] javac option: org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
[DEBUG] javac option: -d
[DEBUG] javac option:
C:\Users\Christian\Documents\someproject\target\classes
[DEBUG] javac option: -s
[DEBUG] javac option:
C:\Users\Christian\Documents\someproject\target\test-metamodel
Regards,
Christian
Am 05.10.2016 um 09:04 schrieb Alan Bateman:
> On 05/10/2016 07:24, Christian Beikov wrote:
>
>> So --add-modules didn't work, I still had the same exception. That's
>> because the annotation processor is trying to instantiate classes
>> from that module. When trying -J--add-modules it says: invalid flag:
>> -J--add-modules=java.xml.bind
>>
>> Any ideas?
> If this is just the annotation processor using a type in module
> java.xml.bind then specifying -J--add-modules=java.xml.bind to javac
> should do it. Can you paste the command into a reply?
>
> -Alan
More information about the jigsaw-dev
mailing list