You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@incubator.apache.org by jm...@apache.org on 2022/09/20 08:00:29 UTC

[incubator] 03/46: - Made the archetype automatically reference the current training tools version - Made the build include NOTICE, LICENSE and DISCLAIMER in every generated artifact - Made the assembly plugin have "apache" and "incubating" in the source bundle's name

This is an automated email from the ASF dual-hosted git repository.

jmclean pushed a commit to branch ApacheConSlides
in repository https://gitbox.apache.org/repos/asf/incubator.git

commit 771a15813d69955ffb4cf12d590b3b4c060ac0e9
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Wed Sep 9 15:19:23 2020 +0200

    - Made the archetype automatically reference the current training tools version
    - Made the build include NOTICE, LICENSE and DISCLAIMER in every generated artifact
    - Made the assembly plugin have "apache" and "incubating" in the source bundle's name
---
 tools/content-archetype/pom.xml                    | 26 ++++++++++++++--
 .../META-INF/maven/archetype-metadata.xml          |  9 +++++-
 .../src/main/resources/archetype-resources/pom.xml |  2 +-
 .../resources/projects/basic/archetype.properties  |  1 +
 tools/pom.xml                                      | 36 ++++++++++++++++++++++
 5 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/tools/content-archetype/pom.xml b/tools/content-archetype/pom.xml
index 9a5c67da..de4102c0 100644
--- a/tools/content-archetype/pom.xml
+++ b/tools/content-archetype/pom.xml
@@ -37,15 +37,37 @@
       <extension>
         <groupId>org.apache.maven.archetype</groupId>
         <artifactId>archetype-packaging</artifactId>
-        <version>3.0.1</version>
+        <version>3.2.0</version>
       </extension>
     </extensions>
 
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>prepare-package</phase>
+            <configuration>
+              <target>
+                <replace token="APACHE_TRAINING_TOOLS_VERSION" value="${project.version}" dir="target/classes">
+                  <include name="**/archetype-metadata.xml" />
+                </replace>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+
     <pluginManagement>
       <plugins>
         <plugin>
           <artifactId>maven-archetype-plugin</artifactId>
-          <version>3.0.1</version>
+          <version>3.2.0</version>
         </plugin>
       </plugins>
     </pluginManagement>
diff --git a/tools/content-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/tools/content-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
index 29fbfa4d..28d79d0c 100644
--- a/tools/content-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/tools/content-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -17,9 +17,15 @@
   limitations under the License.
 
 -->
-<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="presentation-template"
+<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+                      name="apache-training-presentation-template"
     xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <requiredProperties>
+    <requiredProperty key="apacheTrainingToolsVersion">
+      <defaultValue>APACHE_TRAINING_TOOLS_VERSION</defaultValue>
+    </requiredProperty>
+  </requiredProperties>
   <fileSets>
     <fileSet filtered="true" packaged="true" encoding="UTF-8">
       <directory>src/main/java</directory>
@@ -45,6 +51,7 @@
       <includes>
         <include>install-deps-centos.sh</include>
         <include>install-deps-mac.sh</include>
+        <include>pom.xml</include>
         <include>README.md</include>
       </includes>
     </fileSet>
diff --git a/tools/content-archetype/src/main/resources/archetype-resources/pom.xml b/tools/content-archetype/src/main/resources/archetype-resources/pom.xml
index 333f8a18..98057966 100644
--- a/tools/content-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/tools/content-archetype/src/main/resources/archetype-resources/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.training</groupId>
         <artifactId>content-parent-pom</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
+        <version>${apacheTrainingToolsVersion}</version>
 
         <!-- Required in our case as per http://maven.apache.org/ref/3.0.3/maven-model/maven.html#class_parent -->
         <relativePath></relativePath>
diff --git a/tools/content-archetype/src/test/resources/projects/basic/archetype.properties b/tools/content-archetype/src/test/resources/projects/basic/archetype.properties
index e76dca75..984ff8e9 100644
--- a/tools/content-archetype/src/test/resources/projects/basic/archetype.properties
+++ b/tools/content-archetype/src/test/resources/projects/basic/archetype.properties
@@ -21,3 +21,4 @@ package=it.pkg
 version=0.1-SNAPSHOT
 groupId=archetype.it
 artifactId=basic
+apacheTrainingToolsVersion=1.0.0
diff --git a/tools/pom.xml b/tools/pom.xml
index e957c6c0..09852017 100644
--- a/tools/pom.xml
+++ b/tools/pom.xml
@@ -60,7 +60,43 @@
           <autoVersionSubmodules>true</autoVersionSubmodules>
         </configuration>
       </plugin>
+      <!-- Generate the legally required text files in the jars -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-remote-resources-plugin</artifactId>
+        <version>1.7.0</version>
+        <executions>
+          <execution>
+            <id>process-resource-bundles</id>
+            <goals>
+              <goal>process</goal>
+            </goals>
+            <configuration>
+              <resourceBundles>
+                <!-- Will generate META-INF/{DEPENDENCIES,LICENSE,NOTICE} -->
+                <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
+                <!-- Will generate META-INF/DISCLAIMER  -->
+                <resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle>
+              </resourceBundles>
+              <!-- Content in this directory will be appended to generated resources -->
+              <appendedResourcesDirectory>${basedir}/src/remote-resources</appendedResourcesDirectory>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
+
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-assembly-plugin</artifactId>
+          <configuration>
+            <finalName>apache-training-incubating-tools-${project.version}</finalName>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
   </build>
 
 </project>


---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org