Robert Patrick created MCOMPILER-553:
----------------------------------------

             Summary: Multi-release build generates compilerSourceRoots is 
read-only warning
                 Key: MCOMPILER-553
                 URL: https://issues.apache.org/jira/browse/MCOMPILER-553
             Project: Maven Compiler Plugin
          Issue Type: Bug
    Affects Versions: 3.10.1
            Reporter: Robert Patrick


We are building a multi-release jar in a module of our project.  As such, the 
directory structure looks like this:

{{src/main}}
{{    java}}
{{{}    java17{}}}{{{}{}}}

To get this to work, we are doing the following:

{{<plugin>}}
{{  <groupId>org.apache.maven.plugins</groupId>}}
{{  <artifactId>maven-compiler-plugin</artifactId>}}
{{  <executions>}}
{{    <execution>}}
{{      <id>default-compile</id>}}
{{      <goals>}}
{{        <goal>compile</goal>}}
{{      </goals>}}
{{      <configuration>}}
{{        <source>7</source>}}
{{        <target>7</target>}}
{{      </configuration>}}
{{    </execution>}}
{{    <execution>}}
{{      <id>compile-java-17</id>}}
{{      <goals>}}
{{        <goal>compile</goal>}}
{{      </goals>}}
{{      <configuration>}}
{{        <release>17</release>}}
{{        <source>17</source>}}
{{        <target>17</target>}}
{{        <compileSourceRoots>}}
{{          
<compileSourceRoot>${project.basedir}/src/main/java17</compileSourceRoot>}}
{{        </compileSourceRoots>}}
{{        <multiReleaseOutput>true</multiReleaseOutput>}}
{{      </configuration>}}
{{    </execution>}}
{{  </executions>}}
{{</plugin>}}

The build works fine but I am getting this annoying warning:

[*INFO*] *---* compiler:3.10.1:compile *(compile-java-17)* @ 
weblogic-deploy-core *---*

[*WARNING*]  Parameter 'compileSourceRoots' is read-only, must not be used in 
configuration

[*INFO*] Changes detected - recompiling the module!

[*INFO*] Compiling 2 source files to 
/Users/rpatrick/Projects/weblogic-deploy-tooling/core/target/classes/META-INF/versions/17

[*INFO*] 

 

I have tried using includes and excludes instead but that results in all 
classes from src/main/java in the JAR file's META_INF/versions/17 directory.  
If there is a better way to accomplish this, please let me know.  Otherwise, I 
think it is wrong to print a warning for something that appears to be the only 
way to make it work.

 

 

 

 

 

 

 

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to