[
https://issues.apache.org/jira/browse/MWAR-405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15967002#comment-15967002
]
ASF GitHub Bot commented on MWAR-405:
-------------------------------------
GitHub user eolivelli reopened a pull request:
https://github.com/apache/maven-plugins/pull/112
MWAR-405 Workaround XStream incompatibility with Java9
This is a proof-of-concept implementation of a possible way to word-around
the actual incompatibility of xstreams default converters with java9.
As the maven-war-plugin does not need all of the converters (like
TreeMapConverter which is the primary cause of the issue) we can just register
only the needed ones and bypass the java9 issue
see
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to
make field private final java.util.Comparator java.util.TreeMap.comparator
accessible: module java.base does not "opens java.util" to unnamed module
Happens while initializing
org.apache.maven.plugins.war.util.WebappStructureSerializer
at
https://cwiki.apache.org/confluence/display/MAVEN/Java+9+-+Jigsaw
this PR is just a proof-of-concept, there is an email thread on the dev
list. If the idea is accepted I will submit a JIRA and official PR (some code
cleanup is needed at least)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/eolivelli/maven-plugins
maven-war-plugin-easy-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/maven-plugins/pull/112.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #112
----
commit 9bd4409a309d461ffc77dda06b11d295797d3b27
Author: eolivelli <[email protected]>
Date: 2017-04-11T08:07:36Z
MWAR-405 Workaround XStream incompatibility with Java9
Register only used Converters
----
> Workaround XStream incompatibility with Java9
> ---------------------------------------------
>
> Key: MWAR-405
> URL: https://issues.apache.org/jira/browse/MWAR-405
> Project: Maven WAR Plugin
> Issue Type: Bug
> Affects Versions: 3.0.0
> Reporter: Enrico Olivelli
> Assignee: Robert Scholte
> Priority: Blocker
>
> The problem is that XStreams tries to access "comparator" field of
> java.util.TreeMap and this is forbidden in Java9
> {code}
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make
> field private final java.util.Comparator java.util.TreeMap.comparator
> accessible: module java.base does not "opens java.util" to unnamed module
> Happens while initializing
> org.apache.maven.plugins.war.util.WebappStructureSerializer
> {code}
> A possibile workaround is to change the initialization of XStreams in a way
> that only useful converters are registers, thus bypassing the problem
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)