In order to avoid illegal access warnings for jfxrt.jar I manually changed my classpath file to include access rules:
Wanted classpath entry
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
<accessrules>
<accessrule kind="accessible" pattern="javafx/**"/>
<accessrule kind="accessible" pattern="com/sun/javafx/**"/>
</accessrules>
</classpathentry>
If I execute my pom.xml file, the tag accessrule is removed and the new entry is
Classpath entry currently produced by pom.xml / M2E
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
This is because the information about the access rules is not included in my pom.xml file. How can I modify my pom.xml file to produce the wanted classpath file?
Can I do so using some configuration for the maven-compiler-plugin?
Or do I have to use some extra maven plugin to modify the classpath text file?
Or is it not possible to address this in the pom.xml file at all and I would have to write a feature request for M2E?
Here is a snippet from my pom.xml file (I use pom packaging):
Curent pom.xml entry for compile phase
<!-- ### COMPILE ### phase -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<!-- specify current java version here: -->
<source>1.8</source>
<target>1.8</target>
</configuration>
<executions>
<execution>
<id>compile-execution</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>org.treez.test-compile-execution</id>
<phase>org.treez.test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>