maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Gold <russell.g...@oracle.com>
Subject Re: maven compiler plugin multiReleaseOutput option and previous versions
Date Tue, 12 Feb 2019 20:00:35 GMT
I just looked at the code. It is only adding the versioned class paths when there is a module
descriptor in the current source directory. I might be able to put one in here, as a workaround.

> On Feb 12, 2019, at 2:47 PM, Robert Scholte <rfscholte@apache.org> wrote:
> 
> I thought I had written an IT for it, but can't find it.
> Looks like you found a bug.
> 
> Robert
> 
> On Tue, 12 Feb 2019 20:03:10 +0100, Russell Gold <russell.gold@oracle.com> wrote:
> 
>> But it doesn’t appear to be working for me.
>> 
>>> [INFO] --- maven-compiler-plugin:3.8.0:compile (java9) @ pfl-basic ---
>>> [DEBUG] Configuring mojo org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile
from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-compiler-plugin:3.8.0,
parent: jdk.internal.loader.ClassLoaders$AppClassLoader@799f7e29]
>>> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile'
with basic configurator -->
>>> [DEBUG]   (f) basedir = /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic
>>> [DEBUG]   (f) buildDirectory = /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target
>>> [DEBUG]   (f) compilePath = [/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes]
>>> [DEBUG]   (f) compileSourceRoots = [/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9]
>>> [DEBUG]   (f) compilerId = javac
>>> [DEBUG]   (f) debug = true
>>> [DEBUG]   (f) encoding = UTF-8
>>> [DEBUG]   (f) failOnError = true
>>> [DEBUG]   (f) failOnWarning = false
>>> [DEBUG]   (f) forceJavacCompilerUse = false
>>> [DEBUG]   (f) fork = false
>>> [DEBUG]   (f) generatedSourcesDirectory = /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
>>> [DEBUG]   (f) jdkToolchain = {version=9}
>>> [DEBUG]   (f) mojoExecution = org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile
{execution: java9}
>>> [DEBUG]   (f) multiReleaseOutput = true
>>> [DEBUG]   (f) optimize = false
>>> [DEBUG]   (f) outputDirectory = /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes
>>> [DEBUG]   (f) parameters = false
>>> [DEBUG]   (f) project = MavenProject: org.glassfish.pfl:pfl-basic:4.0.1-SNAPSHOT
@ /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/pom.xml
>>> [DEBUG]   (f) projectArtifact = org.glassfish.pfl:pfl-basic:jar:4.0.1-SNAPSHOT
>>> [DEBUG]   (s) release = 9
>>> [DEBUG]   (f) session = org.apache.maven.execution.MavenSession@7640a5b1
>>> [DEBUG]   (f) showDeprecation = false
>>> [DEBUG]   (f) showWarnings = false
>>> [DEBUG]   (f) skipMultiThreadWarning = false
>>> [DEBUG]   (f) source = 1.7
>>> [DEBUG]   (f) staleMillis = 0
>>> [DEBUG]   (s) target = 1.7
>>> [DEBUG]   (f) useIncrementalCompilation = true
>>> [DEBUG]   (f) verbose = false
>>> [DEBUG] -- end configuration --
>>> [DEBUG] Using compiler 'javac'.
>>> [DEBUG] Toolchain JDK[/Library/Java/JavaVirtualMachines/1.6.0_41-b02-445.jdk/Contents/Home]
doesn't match required property: version
>>> [DEBUG] Toolchain JDK[/Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home]
doesn't match required property: version
>>> [DEBUG] Toolchain JDK[/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home]
doesn't match required property: version
>>> [DEBUG] Toolchain JDK[/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home]
doesn't match required property: version
>>> [INFO] Toolchain in maven-compiler-plugin: JDK[/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home]
>>> [DEBUG] Adding /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
to compile source roots:
>>>  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java
>>>  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
>>> [DEBUG] New compile source roots:
>>>  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java
>>>  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
>>> [DEBUG] CompilerReuseStrategy: reuseCreated
>>> [DEBUG] useIncrementalCompilation enabled
>>> [DEBUG] Stale source detected: /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9/org/glassfish/pfl/basic/reflection/Bridge.java
>>> [DEBUG] Stale source detected: /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9/org/glassfish/pfl/basic/reflection/BridgeBase9.java
>>> [INFO] Changes detected - recompiling the module!
>>> [DEBUG] Classpath:
>>> [DEBUG]  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes
>>> [DEBUG] Source roots:
>>> [DEBUG]  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9
>>> [DEBUG] Excutable:
>>> [DEBUG]  /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/javac
>>> [DEBUG] Command line options:
>>> [DEBUG] -d /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes/META-INF/versions/9
-classpath /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes: -sourcepath
/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9:/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations:
/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9/org/glassfish/pfl/basic/reflection/Bridge.java
/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9/org/glassfish/pfl/basic/reflection/BridgeBase9.java
-s /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
-g -nowarn --release 9 -encoding UTF-8
>>> [DEBUG] incrementalBuildHelper#beforeRebuildExecution
>>> [INFO] Compiling 2 source files to /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes/META-INF/versions/9
>>> [DEBUG] incrementalBuildHelper#afterRebuildExecution
>>> [WARNING] /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9/org/glassfish/pfl/basic/reflection/BridgeBase9.java:[23,18]
ReflectionFactory is internal proprietary API and may be removed in a future release
>>> [WARNING] /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9/org/glassfish/pfl/basic/reflection/BridgeBase9.java:[26,18]
ReflectionFactory is internal proprietary API and may be removed in a future release
>>> [WARNING] /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java9/org/glassfish/pfl/basic/reflection/BridgeBase9.java:[30,28]
ReflectionFactory is internal proprietary API and may be removed in a future release
>>> [INFO]
>>> [INFO] --- maven-compiler-plugin:3.8.0:compile (java11) @ pfl-basic ---
>>> [DEBUG] Configuring mojo org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile
from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-compiler-plugin:3.8.0,
parent: jdk.internal.loader.ClassLoaders$AppClassLoader@799f7e29]
>>> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile'
with basic configurator -->
>>> [DEBUG]   (f) basedir = /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic
>>> [DEBUG]   (f) buildDirectory = /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target
>>> [DEBUG]   (f) compilePath = [/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes]
>>> [DEBUG]   (f) compileSourceRoots = [/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java11]
>>> [DEBUG]   (f) compilerId = javac
>>> [DEBUG]   (f) debug = true
>>> [DEBUG]   (f) encoding = UTF-8
>>> [DEBUG]   (f) failOnError = true
>>> [DEBUG]   (f) failOnWarning = false
>>> [DEBUG]   (f) forceJavacCompilerUse = false
>>> [DEBUG]   (f) fork = false
>>> [DEBUG]   (f) generatedSourcesDirectory = /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
>>> [DEBUG]   (f) jdkToolchain = {version=11}
>>> [DEBUG]   (f) mojoExecution = org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile
{execution: java11}
>>> [DEBUG]   (f) multiReleaseOutput = true
>>> [DEBUG]   (f) optimize = false
>>> [DEBUG]   (f) outputDirectory = /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes
>>> [DEBUG]   (f) parameters = false
>>> [DEBUG]   (f) project = MavenProject: org.glassfish.pfl:pfl-basic:4.0.1-SNAPSHOT
@ /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/pom.xml
>>> [DEBUG]   (f) projectArtifact = org.glassfish.pfl:pfl-basic:jar:4.0.1-SNAPSHOT
>>> [DEBUG]   (s) release = 11
>>> [DEBUG]   (f) session = org.apache.maven.execution.MavenSession@7640a5b1
>>> [DEBUG]   (f) showDeprecation = false
>>> [DEBUG]   (f) showWarnings = false
>>> [DEBUG]   (f) skipMultiThreadWarning = false
>>> [DEBUG]   (f) source = 1.7
>>> [DEBUG]   (f) staleMillis = 0
>>> [DEBUG]   (s) target = 1.7
>>> [DEBUG]   (f) useIncrementalCompilation = true
>>> [DEBUG]   (f) verbose = false
>>> [DEBUG] -- end configuration --
>>> [DEBUG] Using compiler 'javac'.
>>> [DEBUG] Toolchain JDK[/Library/Java/JavaVirtualMachines/1.6.0_41-b02-445.jdk/Contents/Home]
doesn't match required property: version
>>> [DEBUG] Toolchain JDK[/Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk/Contents/Home]
doesn't match required property: version
>>> [DEBUG] Toolchain JDK[/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home]
doesn't match required property: version
>>> [DEBUG] Toolchain JDK[/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home]
doesn't match required property: version
>>> [INFO] Toolchain in maven-compiler-plugin: JDK[/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home]
>>> [DEBUG] Adding /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
to compile source roots:
>>>  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java
>>>  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
>>> [DEBUG] New compile source roots:
>>>  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java
>>>  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
>>> [DEBUG] CompilerReuseStrategy: reuseCreated
>>> [DEBUG] useIncrementalCompilation enabled
>>> [DEBUG] Stale source detected: /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java11/org/glassfish/pfl/basic/reflection/Bridge.java
>>> [INFO] Changes detected - recompiling the module!
>>> [DEBUG] Classpath:
>>> [DEBUG]  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes
>>> [DEBUG] Source roots:
>>> [DEBUG]  /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java11
>>> [DEBUG] Excutable:
>>> [DEBUG]  /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin/javac
>> 
>> Note that the release 9 classes were not added to the classpath, here. Just the main
output directory.
>> 
>>> [DEBUG] Command line options:
>>> [DEBUG] -d /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes/META-INF/versions/11
-classpath /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes: -sourcepath
/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java11:/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations:
/Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java11/org/glassfish/pfl/basic/reflection/Bridge.java
-s /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/generated-sources/annotations
-g -nowarn --release 11 -encoding UTF-8
>>> [DEBUG] incrementalBuildHelper#beforeRebuildExecution
>>> [INFO] Compiling 1 source file to /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/target/classes/META-INF/versions/11
>>> [DEBUG] incrementalBuildHelper#afterRebuildExecution
>>> [INFO] -------------------------------------------------------------
>>> [ERROR] COMPILATION ERROR :
>>> [INFO] -------------------------------------------------------------
>>> [ERROR] /Users/rgold/projects/eclipse-ee4j/orb-gmbal-pfl/pfl-basic/src/main/java11/org/glassfish/pfl/basic/reflection/Bridge.java:[51,34]
error: cannot find symbol
>>>  symbol: class BridgeBase9
>>> [INFO] 1 error
>> 
>> 
>>> On Feb 12, 2019, at 1:08 PM, Robert Scholte <rfscholte@apache.org> wrote:
>>> 
>>> Hi Russ,
>>> 
>>> There's no way to configure this, the plugin will do it for you[1]
>>> 
>>> thanks,
>>> Robert
>>> 
>>> [1] https://github.com/apache/maven-compiler-plugin/blob/master/src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java#L328-L346
>>> 
>>> On Tue, 12 Feb 2019 18:56:52 +0100, Russell Gold <russell.gold@oracle.com>
wrote:
>>> 
>>>> Version 3.8.0 of the maven-compiler-plugin supports a multiReleaseOutput
option which can compile classes directly to the appropriate META-INF/versions/{release} directory,
which is very nice. What I don’t see, though, is how to tell it to use the previous release
as its dependency. That is, given:
>>>> 
>>>> src
>>>> |—— main
>>>>      |—— java
>>>>      |—— java9
>>>>      \—— java11
>>>> 
>>>> These directories will be compiled to:
>>>> 
>>>> target/classes, target/classes/META-INF/9 and target/classes/META-INF/11.
But when I compile that last directory, I want to include target/classes/META-INF/9 in my
class path, and I don’t see an obvious way to do it. It would be great if the plugin realized
that this was necessary, but is there a way to configure it?
>>>> 
>>>> Thanks,
>>>> Russ
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message