From 62ecda8240ae13034b7251e0c7ee997fe0ff1c8c Mon Sep 17 00:00:00 2001 From: miconis Date: Mon, 3 Apr 2023 09:31:27 +0200 Subject: [PATCH] dhp build implementation updated --- .../dhp-build-assembly-resources/pom.xml | 25 ++-- .../dhp-build-properties-maven-plugin/pom.xml | 130 ++++++++++++++++-- .../GenerateOoziePropertiesMojo.java | 9 +- .../WritePredefinedProjectProperties.java | 21 +-- .../GenerateOoziePropertiesMojoTest.java | 4 +- .../WritePredefinedProjectPropertiesTest.java | 16 +-- .../test.properties | 3 +- dhp-build/dhp-code-style/pom.xml | 52 +++++-- dhp-build/pom.xml | 26 ++-- 9 files changed, 213 insertions(+), 73 deletions(-) diff --git a/dhp-build/dhp-build-assembly-resources/pom.xml b/dhp-build/dhp-build-assembly-resources/pom.xml index bc0f9c0..7c43c02 100644 --- a/dhp-build/dhp-build-assembly-resources/pom.xml +++ b/dhp-build/dhp-build-assembly-resources/pom.xml @@ -1,8 +1,8 @@ - + + 4.0.0 + eu.dnetlib dhp-build @@ -10,11 +10,18 @@ dhp-build-assembly-resources + 1.0.0-SNAPSHOT + jar - - 8 - 8 - UTF-8 - + This module contains a set of scripts supporting the build lifecycle for the dnet-hadoop project - \ No newline at end of file + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.plugin.version} + + + + diff --git a/dhp-build/dhp-build-properties-maven-plugin/pom.xml b/dhp-build/dhp-build-properties-maven-plugin/pom.xml index cf62269..6264219 100644 --- a/dhp-build/dhp-build-properties-maven-plugin/pom.xml +++ b/dhp-build/dhp-build-properties-maven-plugin/pom.xml @@ -1,8 +1,8 @@ - + + 4.0.0 + eu.dnetlib dhp-build @@ -10,11 +10,123 @@ dhp-build-properties-maven-plugin + 1.0.0-SNAPSHOT + maven-plugin - - 8 - 8 - UTF-8 - + This module is a maven plugin implementing custom properties substitutions in the build lifecycle - \ No newline at end of file + + + org.apache.maven + maven-plugin-api + 3.6.3 + provided + + + org.apache.maven + maven-project + 2.2.1 + provided + + + org.apache.maven + maven-artifact + 2.2.1 + provided + + + + org.kuali.maven.plugins + properties-maven-plugin + ${properties.maven.plugin.version} + + + com.google.code.findbugs + annotations + 3.0.1 + provided + + + com.google.code.findbugs + jsr305 + 3.0.1 + provided + + + + + org.mockito + mockito-core + ${mockito-core.version} + test + + + + org.mockito + mockito-junit-jupiter + ${mockito-core.version} + test + + + + + + + target + target/classes + ${project.artifactId}-${project.version} + target/test-classes + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.plugin.version} + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + verify + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + 3.2 + + true + + + + mojo-descriptor + process-classes + + descriptor + + + + + + + + + + diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java b/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java index 10a25fd..28e3715 100644 --- a/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java +++ b/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojo.java @@ -1,16 +1,15 @@ - package eu.dnetlib.maven.plugin.properties; -import java.io.File; -import java.util.ArrayList; -import java.util.List; - import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; +import java.io.File; +import java.util.ArrayList; +import java.util.List; + /** * Generates oozie properties which were not provided from commandline. * diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java b/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java index d195ca8..76b2f75 100644 --- a/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java +++ b/dhp-build/dhp-build-properties-maven-plugin/src/main/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectProperties.java @@ -12,19 +12,7 @@ package eu.dnetlib.maven.plugin.properties; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Map.Entry; -import java.util.Properties; -import java.util.Set; - +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; @@ -36,7 +24,12 @@ import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; +import java.util.Map.Entry; /** * Writes project properties for the keys listed in specified properties files. Based on: diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java b/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java index cd86358..3637aac 100644 --- a/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java +++ b/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/GenerateOoziePropertiesMojoTest.java @@ -1,13 +1,13 @@ package eu.dnetlib.maven.plugin.properties; +import org.junit.jupiter.api.*; + import static eu.dnetlib.maven.plugin.properties.GenerateOoziePropertiesMojo.PROPERTY_NAME_SANDBOX_NAME; import static eu.dnetlib.maven.plugin.properties.GenerateOoziePropertiesMojo.PROPERTY_NAME_WF_SOURCE_DIR; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import org.junit.jupiter.api.*; - /** @author mhorst, claudio.atzori */ public class GenerateOoziePropertiesMojoTest { diff --git a/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectPropertiesTest.java b/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectPropertiesTest.java index 2cdbae4..fbb86ce 100644 --- a/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectPropertiesTest.java +++ b/dhp-build/dhp-build-properties-maven-plugin/src/test/java/eu/dnetlib/maven/plugin/properties/WritePredefinedProjectPropertiesTest.java @@ -1,14 +1,6 @@ package eu.dnetlib.maven.plugin.properties; -import static eu.dnetlib.maven.plugin.properties.WritePredefinedProjectProperties.PROPERTY_PREFIX_ENV; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.lenient; - -import java.io.*; -import java.util.Properties; - import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.junit.jupiter.api.*; @@ -18,6 +10,14 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.junit.jupiter.MockitoExtension; +import java.io.*; +import java.util.Properties; + +import static eu.dnetlib.maven.plugin.properties.WritePredefinedProjectProperties.PROPERTY_PREFIX_ENV; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.lenient; + /** @author mhorst, claudio.atzori */ @Disabled @ExtendWith(MockitoExtension.class) diff --git a/dhp-build/dhp-build-properties-maven-plugin/test.properties b/dhp-build/dhp-build-properties-maven-plugin/test.properties index d17c4d8..cfcfbd5 100644 --- a/dhp-build/dhp-build-properties-maven-plugin/test.properties +++ b/dhp-build/dhp-build-properties-maven-plugin/test.properties @@ -1 +1,2 @@ -# Tue Apr 19 15:27:59 CEST 2022 +# Sun Apr 02 15:21:44 CEST 2023 +projectPropertyKey=projectPropertyValue diff --git a/dhp-build/dhp-code-style/pom.xml b/dhp-build/dhp-code-style/pom.xml index b057fe4..a4f3e33 100644 --- a/dhp-build/dhp-code-style/pom.xml +++ b/dhp-build/dhp-code-style/pom.xml @@ -1,20 +1,48 @@ - - 4.0.0 - - eu.dnetlib - dhp-build - 1.0-SNAPSHOT - + + 4.0.0 + + eu.dnetlib dhp-code-style + 1.0.0-SNAPSHOT + + jar + + This module contains resources supporting common code style conventions + + + + dnet45-snapshots + DNet45 Snapshots + https://maven.d4science.org/nexus/content/repositories/dnet45-snapshots + default + + + dnet45-releases + https://maven.d4science.org/nexus/content/repositories/dnet45-releases + + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-site-plugin + 3.7.1 + + + + - 8 - 8 UTF-8 - \ No newline at end of file + diff --git a/dhp-build/pom.xml b/dhp-build/pom.xml index 1fd777a..136b4f2 100644 --- a/dhp-build/pom.xml +++ b/dhp-build/pom.xml @@ -1,21 +1,21 @@ - + 4.0.0 - org.example + eu.dnetlib dnet-and - 1.0-SNAPSHOT + 1.0.0-SNAPSHOT + ../pom.xml - - eu.dnetlib dhp-build + pom - - 8 - 8 - UTF-8 - + This module is a container for the build tools used in dnet-hadoop - \ No newline at end of file + + dhp-build-assembly-resources + dhp-build-properties-maven-plugin + dhp-code-style + + +