Alan Czajkowski created MPH-178:
-----------------------------------

             Summary: help:evaluate throws serious warnings
                 Key: MPH-178
                 URL: https://issues.apache.org/jira/browse/MPH-178
             Project: Maven Help Plugin
          Issue Type: Bug
            Reporter: Alan Czajkowski


h2. Problem

*{{mvn help:evaluate}}* throws serious warnings:

{code:sh}
$ mvn help:evaluate -Dexpression=project.modules --quiet -DforceStdout
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields 
(file:/Users/alan/.m2/repository/com/thoughtworks/xstream/xstream/1.4.11.1/xstream-1.4.11.1.jar)
 to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of 
com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release
<strings>
  <string>child-1</string>
  <string>child-2</string>
  <string>child-3</string>
</strings>
{code}

h2. Background

Maven & JDK version:
{code:sh}
$ mvn -v
Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
Maven home: /usr/local/Cellar/maven/3.8.2/libexec
Java version: 11.0.12, vendor: Amazon.com Inc., runtime: 
/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
{code}

Create a multi-module project similar to:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.example</groupId>
  <artifactId>parent</artifactId>
  <version>1.0.0-SNAPSHOT</version>

  <packaging>pom</packaging>

  <name>Example - Parent</name>
  <description>${project.name}</description>

  <modules>
    <module>child-1</module>
    <module>child-2</module>
    <module>child-3</module>
  </modules>

  ...
{code}

h2. Solution

adding the latest xstream dependency fixes the problem:

{code:xml}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-help-plugin</artifactId>
        <version>3.2.0</version>
        <dependencies>
          <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.4.18</version>
          </dependency>
        </dependencies>
      </plugin>
{code}



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

Reply via email to