Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions hadoop-hdds/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,6 @@

<build>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
Expand Down
14 changes: 0 additions & 14 deletions hadoop-hdds/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,20 +262,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
<execution>
<id>rename-generated-test-config</id>
<phase>process-test-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions hadoop-hdds/config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
<annotationProcessors>
<annotationProcessor>org.apache.hadoop.hdds.conf.ConfigFileGenerator</annotationProcessor>
</annotationProcessors>
<compilerArgs>
<arg>-AartifactId=</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
@SupportedSourceVersion(SourceVersion.RELEASE_8)
public class ConfigFileGenerator extends AbstractProcessor {

public static final String OUTPUT_FILE_NAME = "ozone-default-generated.xml";
private static final String OUTPUT_FILE_NAME = "ozone-default-generated.xml";
private static final String OUTPUT_FILE_POSTFIX = "-default.xml";

private static final SimpleTypeVisitor8<Element, Void> GET_PARENT_ELEMENT =
new SimpleTypeVisitor8<Element, Void>() {
Expand All @@ -73,9 +74,16 @@ public boolean process(Set<? extends TypeElement> annotations,
//load existing generated config (if exists)
boolean resourceExists = true;
ConfigFileAppender appender = new ConfigFileAppender();
String currentArtifactId = processingEnv.getOptions().get("artifactId");
String outputFileName;
if (currentArtifactId == null || currentArtifactId.isEmpty()) {
outputFileName = OUTPUT_FILE_NAME;
} else {
outputFileName = currentArtifactId + OUTPUT_FILE_POSTFIX;
}
try (InputStream input = filer
.getResource(StandardLocation.CLASS_OUTPUT, "",
OUTPUT_FILE_NAME).openInputStream()) {
outputFileName).openInputStream()) {
appender.load(input);
} catch (FileNotFoundException | NoSuchFileException ex) {
appender.init();
Expand Down Expand Up @@ -110,7 +118,7 @@ public boolean process(Set<? extends TypeElement> annotations,
if (!resourceExists) {
FileObject resource = filer
.createResource(StandardLocation.CLASS_OUTPUT, "",
OUTPUT_FILE_NAME);
outputFileName);

try (Writer writer = new OutputStreamWriter(
resource.openOutputStream(), StandardCharsets.UTF_8)) {
Expand Down
10 changes: 0 additions & 10 deletions hadoop-hdds/container-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,6 @@

<build>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
Expand Down
14 changes: 0 additions & 14 deletions hadoop-hdds/framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,6 @@

<build>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
<execution>
<id>rename-generated-test-config</id>
<phase>process-test-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
Expand Down
10 changes: 0 additions & 10 deletions hadoop-hdds/server-scm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,6 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
10 changes: 0 additions & 10 deletions hadoop-ozone/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,6 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-maven-plugins</artifactId>
Expand Down
10 changes: 0 additions & 10 deletions hadoop-ozone/csi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,6 @@

<build>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.salesforce.servicelibs</groupId>
<artifactId>proto-backwards-compatibility</artifactId>
Expand Down
10 changes: 0 additions & 10 deletions hadoop-ozone/ozone-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,6 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
10 changes: 0 additions & 10 deletions hadoop-ozone/recon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,6 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<executions>
<execution>
<id>rename-generated-config</id>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
50 changes: 3 additions & 47 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,9 @@
<version>${maven-compiler-plugin.version}</version>
<configuration>
<useIncrementalCompilation>false</useIncrementalCompilation>
<compilerArgs>
<arg>-AartifactId=${project.artifactId}</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -2170,53 +2173,6 @@
<includeTests>true</includeTests>
</configuration>
</plugin>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>${copy-rename-maven-plugin.version}</version>
<executions>
<!--
If a new module is introduced with generated config:
- override ban-annotations execution of maven-enforcer-plugin
- configure maven-compiler-plugin with the ConfigFileGenerator annotationProcessor
- bind one or both of these rename executions
- add the module's name in OzoneConfiguration#activate
See hadoop-hdds/common/pom.xml for example.
-->
<execution>
<id>rename-generated-config</id>
<goals>
<goal>rename</goal>
</goals>
<!-- bind to process-classes in modules where needed -->
<phase>none</phase>
<configuration>
<fileSets>
<fileSet>
<sourceFile>${project.build.outputDirectory}/ozone-default-generated.xml</sourceFile>
<destinationFile>${project.build.outputDirectory}/${project.artifactId}-default.xml</destinationFile>
</fileSet>
</fileSets>
</configuration>
</execution>
<execution>
<id>rename-generated-test-config</id>
<goals>
<goal>rename</goal>
</goals>
<!-- bind to process-test-classes in modules where needed -->
<phase>none</phase>
<configuration>
<fileSets>
<fileSet>
<sourceFile>${project.build.testOutputDirectory}/ozone-default-generated.xml</sourceFile>
<destinationFile>${project.build.testOutputDirectory}/${project.artifactId}-default.xml</destinationFile>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

Expand Down
Loading