You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (Jira)" <ji...@apache.org> on 2019/11/10 20:57:00 UTC

[jira] [Closed] (MWAR-397) Replace XStream with Modello to merge overlays

     [ https://issues.apache.org/jira/browse/MWAR-397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte closed MWAR-397.
-------------------------------
    Fix Version/s: 3.2.4
         Assignee: Robert Scholte
       Resolution: Resolved

No need for XStream anymore after MWAR-375

> Replace XStream with Modello to merge overlays
> ----------------------------------------------
>
>                 Key: MWAR-397
>                 URL: https://issues.apache.org/jira/browse/MWAR-397
>             Project: Maven WAR Plugin
>          Issue Type: Improvement
>            Reporter: Robert Scholte
>            Assignee: Robert Scholte
>            Priority: Major
>             Fix For: 3.2.4
>
>
> When packaging a war with most recent jigsaw-jdk9-ea releases you will get the following exception:
> {noformat}
> 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 "exports private java.util" to unnamed module @17088b23
>     at jdk.internal.reflect.Reflection.throwInaccessibleObjectException (Reflection.java:414)
>     at java.lang.reflect.AccessibleObject.checkCanSetAccessible (AccessibleObject.java:198)
>     at java.lang.reflect.Field.checkCanSetAccessible (Field.java:171)
>     at java.lang.reflect.Field.setAccessible (Field.java:165)
>     at com.thoughtworks.xstream.core.util.Fields.locate (Fields.java:40)
>     at com.thoughtworks.xstream.converters.collections.TreeMapConverter.<clinit> (TreeMapConverter.java:50)
>     at com.thoughtworks.xstream.XStream.setupConverters (XStream.java:832)
>     at com.thoughtworks.xstream.XStream.<init> (XStream.java:574)
>     at com.thoughtworks.xstream.XStream.<init> (XStream.java:496)
>     at com.thoughtworks.xstream.XStream.<init> (XStream.java:465)
>     at com.thoughtworks.xstream.XStream.<init> (XStream.java:411)
>     at com.thoughtworks.xstream.XStream.<init> (XStream.java:378)
>     at org.apache.maven.plugins.war.util.WebappStructureSerializer.<clinit> (WebappStructureSerializer.java:47)
> {noformat}
> Root cause is the change is the [jigsaw-jdk-9-ea+135|http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-September/009404.html]
> {quote}
> The changes to setAccessible in #AwkwardStrongEncapsulation is going to 
> be disruptive and will no doubt expose hacks in many areas. We've run 
> into several of these already. The command line option to allow existing 
> code to break into non-public types/members is --add-exports-private. 
> The format of the value passed to this option is the same--add-exports. 
> With #AddExportsInManifest then there are equivalents in the application 
> JAR main manifest to try out too.
> {quote}
> The stacktrace exposes that the issue is caused by XStream. It seems that XStream is used to be able to merge overlays. Maven and most other plugins use Modello for these kind of things.
> There's still a lot of discussion about #ReflectiveAccessToNonExportedTypes and #AwkwardStrongEncapsulation and but I think we can avoid this issue by simply switching to the well known Modello solution.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)