Skip to content

Commit ab59399

Browse files
gzm55slandelle
authored andcommitted
use maven.compiler.release option for scala sources
1 parent 6132cc8 commit ab59399

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/main/java/scala_maven/ScalaMojoSupport.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@ public abstract class ScalaMojoSupport extends AbstractMojo {
9999
@Parameter(property = "addScalacArgs")
100100
private String addScalacArgs;
101101

102-
/** The -target argument for the Scala compiler. */
103-
@Parameter(property = "scala.compiler.target")
104-
protected String scalacTarget;
105-
106-
/** The -release argument for the Scala compiler, supported since scala 2.13. */
107-
@Parameter(property = "scala.compiler.release")
108-
protected String scalacRelease;
109-
110-
111102
/** override the className (FQN) of the scala tool */
112103
@Parameter(required = false, property = "maven.scala.className")
113104
protected String scalaClassName;
@@ -163,7 +154,10 @@ public abstract class ScalaMojoSupport extends AbstractMojo {
163154
@Parameter(property = "maven.compiler.target")
164155
protected String target;
165156

166-
/** The --release argument for the Java compiler (when using incremental compiler), supported since Java9. */
157+
/**
158+
* The --release argument for the Java compiler (when using incremental compiler), supported since
159+
* Java9.
160+
*/
167161
@Parameter(property = "maven.compiler.release")
168162
protected String release;
169163

@@ -591,12 +585,12 @@ protected List<String> getScalaOptions() throws Exception {
591585
}
592586
options.addAll(getCompilerPluginOptions());
593587

594-
if (scalacTarget != null && !scalacTarget.isEmpty()) {
595-
options.add("-target:" + scalacTarget);
588+
if (target != null && !target.isEmpty()) {
589+
options.add("-target:" + target);
596590
}
597-
if (scalacRelease != null && !scalacRelease.isEmpty()) {
591+
if (release != null && !release.isEmpty()) {
598592
options.add("-release");
599-
options.add(scalacRelease);
593+
options.add(release);
600594
}
601595

602596
return options;

0 commit comments

Comments
 (0)