Skip to content

Commit c459d1d

Browse files
authored
Merge pull request #202 from apache/MCOMPILER-550_writeable_outputDirectory
[MCOMPILER-550] make outputDirectory writable
2 parents f77150b + 627c04e commit c459d1d

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/main/java/org/apache/maven/plugin/compiler/CompilerMojo.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,17 @@ public class CompilerMojo extends AbstractCompilerMojo {
7070

7171
/**
7272
* The directory for compiled classes.
73+
* <p>
74+
* This parameter should only be modified in special cases. One example is creating
75+
* a multi-release jar with a lower bytecode level (i.e. setting it to
76+
* {@code ${project.build.outputDirectory}/META-INF/versions/21} or similar) in an additional
77+
* execution.
78+
* <p>
79+
* When the required bytecode level is available though an installed JDK or toolchain,
80+
* it is recommended to use the {@code <release>} property
81+
* in conjunction with the ${multiReleaseOutput} parameter instead.
7382
*/
74-
@Parameter(defaultValue = "${project.build.outputDirectory}", required = true, readonly = true)
83+
@Parameter(defaultValue = "${project.build.outputDirectory}", required = true, readonly = false)
7584
private File outputDirectory;
7685

7786
/**

src/main/java/org/apache/maven/plugin/compiler/TestCompilerMojo.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ public class TestCompilerMojo extends AbstractCompilerMojo {
7575

7676
/**
7777
* The directory where compiled test classes go.
78+
* <p>
79+
* This parameter should only be modified in special cases.
80+
* See the {@link CompilerMojo#outputDirectory} for more information.
81+
*
82+
* @see CompilerMojo#outputDirectory
7883
*/
79-
@Parameter(defaultValue = "${project.build.testOutputDirectory}", required = true, readonly = true)
84+
@Parameter(defaultValue = "${project.build.testOutputDirectory}", required = true, readonly = false)
8085
private File outputDirectory;
8186

8287
/**

0 commit comments

Comments
 (0)