From a1c5b133a1f4f927cc8e4ec6024062dcd69df91e Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Fri, 15 Dec 2023 20:36:39 +0100 Subject: [PATCH] [MCOMPILER-565] Allow project build by Maven 4 --- src/it/mcompiler-106/pom.xml | 6 ++--- src/it/mcompiler-106/verify.groovy | 25 +++++++++++++++++++ .../plugin/compiler/AbstractCompilerMojo.java | 2 +- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 src/it/mcompiler-106/verify.groovy diff --git a/src/it/mcompiler-106/pom.xml b/src/it/mcompiler-106/pom.xml index bb62fffd..edbafc0b 100644 --- a/src/it/mcompiler-106/pom.xml +++ b/src/it/mcompiler-106/pom.xml @@ -34,9 +34,9 @@ under the License. true - - - + + true + diff --git a/src/it/mcompiler-106/verify.groovy b/src/it/mcompiler-106/verify.groovy new file mode 100644 index 00000000..10e4db49 --- /dev/null +++ b/src/it/mcompiler-106/verify.groovy @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +def logFile = new File( basedir, 'build.log' ) +assert logFile.exists() +content = logFile.text + +assert content.contains( ' -Averbose=true' ) +assert content.contains( ' -Xlint' ) + diff --git a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java index b24e6577..fb285afb 100644 --- a/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java +++ b/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java @@ -407,7 +407,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo { /** *

* Sets the unformatted single argument string to be passed to the compiler. To pass multiple arguments such as - * -Xmaxerrs 1000 (which are actually two arguments) you have to use {@link #compilerArguments}. + * -Xmaxerrs 1000 (which are actually two arguments) you have to use {@link #compilerArgs}. *

*

* This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.