diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index c0617e817d..8618e38b3d 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -497,6 +497,8 @@ Release 2.7.0 - UNRELEASED HADOOP-11489 Dropping dependency on io.netty from hadoop-nfs' pom.xml (Ted Yu via ozawa) + HADOOP-11419 Improve hadoop-maven-plugins. (Herve Boutemy via stevel) + OPTIMIZATIONS HADOOP-11323. WritableComparator#compare keeps reference to byte array. diff --git a/hadoop-maven-plugins/pom.xml b/hadoop-maven-plugins/pom.xml index 4beaf7c8b9..b48b9acee5 100644 --- a/hadoop-maven-plugins/pom.xml +++ b/hadoop-maven-plugins/pom.xml @@ -28,6 +28,7 @@ Apache Hadoop Maven Plugins 3.0 + 3.4 @@ -43,30 +44,20 @@ org.apache.maven.plugin-tools maven-plugin-annotations - ${maven.dependency.version} + ${maven.plugin-tools.version} provided - - junit - junit - test - org.apache.maven.plugins maven-plugin-plugin - ${maven.dependency.version} - - true - + ${maven.plugin-tools.version} - mojo-descriptor - - descriptor - + default-descriptor + process-classes diff --git a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java index 86ba7bf529..465b7136a9 100644 --- a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java +++ b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java @@ -31,7 +31,7 @@ @Mojo(name="protoc", defaultPhase = LifecyclePhase.GENERATE_SOURCES) public class ProtocMojo extends AbstractMojo { - @Parameter(defaultValue="${project}") + @Parameter(defaultValue="${project}", readonly=true) private MavenProject project; @Parameter @@ -43,7 +43,7 @@ public class ProtocMojo extends AbstractMojo { @Parameter(required=true) private FileSet source; - @Parameter + @Parameter(defaultValue="protoc") private String protocCommand; @Parameter(required=true) @@ -51,9 +51,6 @@ public class ProtocMojo extends AbstractMojo { public void execute() throws MojoExecutionException { try { - if (protocCommand == null || protocCommand.trim().isEmpty()) { - protocCommand = "protoc"; - } List command = new ArrayList(); command.add(protocCommand); command.add("--version"); diff --git a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/FileSetUtils.java b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/FileSetUtils.java index 8bd66cc4d2..2f2d2fbb60 100644 --- a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/FileSetUtils.java +++ b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/FileSetUtils.java @@ -33,7 +33,7 @@ public class FileSetUtils { * @param list List of all elements * @return String containing every element, comma-separated */ - private static String getCommaSeparatedList(List list) { + private static String getCommaSeparatedList(List list) { StringBuilder buffer = new StringBuilder(); String separator = ""; for (Object e : list) { diff --git a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/versioninfo/VersionInfoMojo.java b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/versioninfo/VersionInfoMojo.java index 563bd5948a..f342463370 100644 --- a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/versioninfo/VersionInfoMojo.java +++ b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/versioninfo/VersionInfoMojo.java @@ -18,7 +18,6 @@ import org.apache.maven.model.FileSet; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; @@ -47,7 +46,7 @@ @Mojo(name="version-info") public class VersionInfoMojo extends AbstractMojo { - @Parameter(defaultValue="${project}") + @Parameter(defaultValue="${project}", readonly=true) private MavenProject project; @Parameter(required=true)