[java-sig-commits] [maven-archetype] Initial commit

Stanislav Ochotnicky sochotni at fedoraproject.org
Mon Sep 26 08:15:35 UTC 2011


commit fdb3a196f534d5a63ae952b4389e49105592a4cc
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Mon Sep 26 10:03:37 2011 +0200

    Initial commit

 .gitignore                                         |    1 +
 ...omponent-metadata-instead-of-maven-plugin.patch |   30 +++
 0002-Use-generics.patch                            |   24 ++
 0003-Add-Maven-3-compatibility.patch               |   47 ++++
 maven-archetype.depmap                             |   14 +
 maven-archetype.spec                               |  256 ++++++++++++++++++++
 sources                                            |    1 +
 7 files changed, 373 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..12eb55b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/maven-archetype-2.1-source-release.zip
diff --git a/0001-Use-component-metadata-instead-of-maven-plugin.patch b/0001-Use-component-metadata-instead-of-maven-plugin.patch
new file mode 100644
index 0000000..0a493b7
--- /dev/null
+++ b/0001-Use-component-metadata-instead-of-maven-plugin.patch
@@ -0,0 +1,30 @@
+From 34b30a865ca534d38d786387ef955486406ef298 Mon Sep 17 00:00:00 2001
+From: Stanislav Ochotnicky <sochotnicky at redhat.com>
+Date: Wed, 14 Sep 2011 13:14:55 +0200
+Subject: [PATCH 1/3] Use component-metadata instead of maven-plugin
+
+---
+ pom.xml |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pom.xml b/pom.xml
+index c6f0762..9ee5296 100644
+--- a/pom.xml
++++ b/pom.xml
+@@ -340,11 +340,11 @@ under the License.
+     <plugins>
+       <plugin>
+         <groupId>org.codehaus.plexus</groupId>
+-        <artifactId>plexus-maven-plugin</artifactId>
++        <artifactId>plexus-component-metadata</artifactId>
+         <executions>
+           <execution>
+             <goals>
+-              <goal>descriptor</goal>
++              <goal>generate-metadata</goal>
+             </goals>
+           </execution>
+         </executions>
+-- 
+1.7.6
+
diff --git a/0002-Use-generics.patch b/0002-Use-generics.patch
new file mode 100644
index 0000000..0ddd20c
--- /dev/null
+++ b/0002-Use-generics.patch
@@ -0,0 +1,24 @@
+From bcc4f55dc27d606d67505f9358648e18ce8fee69 Mon Sep 17 00:00:00 2001
+From: Stanislav Ochotnicky <sochotnicky at redhat.com>
+Date: Wed, 14 Sep 2011 14:05:18 +0200
+Subject: [PATCH 2/3] Use generics
+
+---
+ archetype-models/pom.xml |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/archetype-models/pom.xml b/archetype-models/pom.xml
+index d0edc60..8185b85 100644
+--- a/archetype-models/pom.xml
++++ b/archetype-models/pom.xml
+@@ -38,6 +38,7 @@
+           <artifactId>modello-maven-plugin</artifactId>
+           <configuration>
+             <version>1.0.0</version>
++            <useJava5>true</useJava5>
+           </configuration>
+           <executions>
+             <execution>
+-- 
+1.7.6
+
diff --git a/0003-Add-Maven-3-compatibility.patch b/0003-Add-Maven-3-compatibility.patch
new file mode 100644
index 0000000..8ca1328
--- /dev/null
+++ b/0003-Add-Maven-3-compatibility.patch
@@ -0,0 +1,47 @@
+From 0e3a945271d6a9c7c551c0b8507cf6eda4ddb4b3 Mon Sep 17 00:00:00 2001
+From: Stanislav Ochotnicky <sochotnicky at redhat.com>
+Date: Wed, 14 Sep 2011 15:48:30 +0200
+Subject: [PATCH 3/3] Add Maven 3 compatibility
+
+---
+ archetype-common/pom.xml       |    8 ++++++++
+ maven-archetype-plugin/pom.xml |    4 ++++
+ 2 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/archetype-common/pom.xml b/archetype-common/pom.xml
+index 9eba2dd..e0fa705 100644
+--- a/archetype-common/pom.xml
++++ b/archetype-common/pom.xml
+@@ -66,6 +66,14 @@ under the License.
+     </dependency>
+     <dependency>
+       <groupId>org.apache.maven</groupId>
++      <artifactId>maven-compat</artifactId>
++    </dependency>
++    <dependency>
++      <groupId>org.apache.maven</groupId>
++      <artifactId>maven-core</artifactId>
++    </dependency>
++    <dependency>
++      <groupId>org.apache.maven</groupId>
+       <artifactId>maven-model</artifactId>
+     </dependency>
+     <dependency>
+diff --git a/maven-archetype-plugin/pom.xml b/maven-archetype-plugin/pom.xml
+index 71043d7..95a08d1 100644
+--- a/maven-archetype-plugin/pom.xml
++++ b/maven-archetype-plugin/pom.xml
+@@ -69,6 +69,10 @@ under the License.
+     </dependency>
+     <dependency>
+       <groupId>org.codehaus.plexus</groupId>
++      <artifactId>plexus-interactivity-api</artifactId>
++    </dependency>
++    <dependency>
++      <groupId>org.codehaus.plexus</groupId>
+       <artifactId>plexus-utils</artifactId>
+     </dependency>
+     <dependency>
+-- 
+1.7.6
+
diff --git a/maven-archetype.depmap b/maven-archetype.depmap
new file mode 100644
index 0000000..93dbaf9
--- /dev/null
+++ b/maven-archetype.depmap
@@ -0,0 +1,14 @@
+<dependencies>
+    <dependency>
+      <maven>
+        <groupId>ant</groupId>
+        <artifactId>ant-antlr</artifactId>
+      </maven>
+    </dependency>
+    <jpp>
+      <maven>
+        <groupId>JPP/ant</groupId>
+        <artifactId>ant-antlr</artifactId>
+      </maven>
+    </jpp>
+</dependencies>
diff --git a/maven-archetype.spec b/maven-archetype.spec
new file mode 100644
index 0000000..fe46c6c
--- /dev/null
+++ b/maven-archetype.spec
@@ -0,0 +1,256 @@
+Name:           maven-archetype
+Version:        2.1
+Release:        2%{?dist}
+Summary:        Maven project templating toolkit
+
+Group:          Development/Libraries
+License:        ASL 2.0
+URL:            https://maven.apache.org/archetype/
+Source0:        http://search.maven.org/remotecontent?filepath=org/apache/maven/archetype/%{name}/%{version}/%{name}-%{version}-source-release.zip
+
+# custom depmap needed to resolve ant-antlr which doesn't have pom/depmap
+Source1:        %{name}.depmap
+
+Patch0:         0001-Use-component-metadata-instead-of-maven-plugin.patch
+Patch1:         0002-Use-generics.patch
+Patch2:         0003-Add-Maven-3-compatibility.patch
+
+BuildArch:      noarch
+
+BuildRequires:  jpackage-utils
+# we added test dep skipping there
+BuildRequires:  maven > 3.0.3-13
+BuildRequires:  maven-war-plugin
+BuildRequires:  maven-dependency-plugin
+BuildRequires:  jchardet
+BuildRequires:  plexus-containers-component-metadata
+
+Requires:          jpackage-utils
+Requires:          maven
+
+%description
+Archetype is a Maven project templating toolkit. An archetype is
+defined as an original pattern or model from which all other things of
+the same kind are made. The names fits as we are trying to provide a
+system that provides a consistent means of generating Maven
+projects. Archetype will help authors create Maven project templates
+for users, and provides users with the means to generate parameterized
+versions of those project templates.
+
+Using archetypes provides a great way to enable developers quickly in
+a way consistent with best practices employed by your project or
+organization. Within the Maven project we use archetypes to try and
+get our users up and running as quickly as possible by providing a
+sample project that demonstrates many of the features of Maven while
+introducing new users to the best practices employed by Maven. In a
+matter of seconds a new user can have a working Maven project to use
+as a jumping board for investigating more of the features in Maven. We
+have also tried to make the Archetype mechanism additive and by that
+we mean allowing portions of a project to be captured in an archetype
+so that pieces or aspects of a project can be added to existing
+projects. A good example of this is the Maven site archetype. If, for
+example, you have used the quick start archetype to generate a working
+project you can then quickly create a site for that project by using
+the site archetype within that existing project. You can do anything
+like this with archetypes.
+
+You may want to standardize J2EE development within your organization
+so you may want to provide archetypes for EJBs, or WARs, or for your
+web services. Once these archetypes are created and deployed in your
+organization's repository they are available for use by all developers
+within your organization.
+
+
+%package javadoc
+Summary:        API documentation for %{name}
+Group:          Documentation
+Requires:       jpackage-utils
+
+%description    javadoc
+%{summary}.
+
+%package catalog
+Summary:        Maven Archetype Catalog model
+Group:          Development/Libraries
+Requires:       jpackage-utils
+Requires:       plexus-utils
+Requires:       %{name} = %{version}-%{release}
+
+%description catalog
+%{summary}.
+
+%package descriptor
+Summary:        Maven Archetype Descriptor model
+Group:          Development/Libraries
+Requires:       jpackage-utils
+Requires:       plexus-utils
+Requires:       %{name} = %{version}-%{release}
+
+%description descriptor
+%{summary}.
+
+%package registry
+Summary:        Maven Archetype Registry model
+Group:          Development/Libraries
+Requires:       jpackage-utils
+Requires:       plexus-utils
+Requires:       %{name} = %{version}-%{release}
+
+%description registry
+%{summary}.
+
+%package common
+Summary:        Maven Archetype common classes
+Group:          Development/Libraries
+Requires:       %{name} = %{version}-%{release}
+Requires:       %{name}-catalog = %{version}-%{release}
+Requires:       %{name}-descriptor = %{version}-%{release}
+Requires:       %{name}-registry = %{version}-%{release}
+Requires:       jpackage-utils
+Requires:       plexus-utils
+Requires:       jchardet
+Requires:       dom4j
+Requires:       jdom
+Requires:       maven-project
+Requires:       plexus-containers-container-default
+Requires:       apache-commons-io
+Requires:       plexus-velocity
+
+%description common
+%{summary}.
+
+%package packaging
+Summary:        Maven Archetype packaging configuration for archetypes
+Group:          Development/Libraries
+Requires:       jpackage-utils
+Requires:       %{name} = %{version}-%{release}
+
+%description packaging
+%{summary}.
+
+%package -n %{name}-plugin
+Summary:        Maven Plugin for using archetypes
+Group:          Development/Libraries
+Requires:       jpackage-utils
+Requires:       plexus-utils
+Requires:       apache-commons-collections
+Requires:       %{name} = %{version}-%{release}
+Requires:       %{name}-catalog = %{version}-%{release}
+Requires:       %{name}-descriptor = %{version}-%{release}
+Requires:       %{name}-registry = %{version}-%{release}
+
+%description -n %{name}-plugin
+%{summary}.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+%build
+# we don't have cargo so skip tests for now
+mvn-rpmbuild -X -Dmaven.test.skip=true \
+             -Dmaven.local.depmap.file=%{SOURCE1} \
+             install javadoc:aggregate
+
+%install
+# parent pom
+install -Dpm 644 pom.xml \
+    %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+
+%add_maven_depmap JPP-%{name}.pom
+
+for module in common packaging; do
+    pushd archetype-$module
+    install -Dpm 644 target/archetype-$module-%{version}.jar \
+                     %{buildroot}%{_javadir}/%{name}/$module.jar
+    install -Dpm 644 pom.xml \
+            %{buildroot}%{_mavenpomdir}/JPP.%{name}-$module.pom
+
+    %add_maven_depmap JPP.%{name}-$module.pom %{name}/$module.jar -f $module
+    popd
+done
+
+pushd archetype-models
+     install -Dpm 644 pom.xml \
+                     %{buildroot}%{_mavenpomdir}/JPP-%{name}-models.pom
+
+     %add_maven_depmap JPP-%{name}-models.pom
+
+     for module in catalog descriptor registry;do
+         pushd archetype-$module
+         install -Dpm 644 target/archetype-$module-%{version}.jar \
+                      %{buildroot}%{_javadir}/%{name}/$module.jar
+         install -Dpm 644 pom.xml \
+                      %{buildroot}%{_mavenpomdir}/JPP.%{name}-$module.pom
+
+         %add_maven_depmap JPP.%{name}-$module.pom %{name}/$module.jar -f $module
+         popd
+     done
+popd
+
+pushd %{name}-plugin
+install -Dpm 644 target/%{name}-plugin-%{version}.jar \
+                 %{buildroot}%{_javadir}/%{name}/plugin.jar
+install -Dpm 644 pom.xml \
+        %{buildroot}%{_mavenpomdir}/JPP.%{name}-plugin.pom
+%add_maven_depmap JPP.%{name}-plugin.pom %{name}/plugin.jar -f plugin
+popd
+
+# javadoc
+install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
+cp -rp target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/
+
+
+
+%files
+%doc LICENSE NOTICE
+%{_mavenpomdir}/JPP-%{name}.pom
+%{_mavenpomdir}/JPP-%{name}-models.pom
+%{_mavendepmapfragdir}/%{name}
+%dir %{_javadir}/%{name}
+
+%files javadoc
+%doc LICENSE
+%{_javadocdir}/%{name}
+%exclude %{_javadocdir}/%{name}/javadoc.sh
+
+%files catalog
+%{_mavendepmapfragdir}/%{name}-catalog
+%{_mavenpomdir}/JPP.%{name}-catalog.pom
+%{_javadir}/%{name}/catalog.jar
+
+%files descriptor
+%{_mavendepmapfragdir}/%{name}-descriptor
+%{_mavenpomdir}/JPP.%{name}-descriptor.pom
+%{_javadir}/%{name}/descriptor.jar
+
+%files registry
+%{_mavendepmapfragdir}/%{name}-registry
+%{_mavenpomdir}/JPP.%{name}-registry.pom
+%{_javadir}/%{name}/registry.jar
+
+%files common
+%{_mavendepmapfragdir}/%{name}-common
+%{_mavenpomdir}/JPP.%{name}-common.pom
+%{_javadir}/%{name}/common.jar
+
+%files packaging
+%{_mavendepmapfragdir}/%{name}-packaging
+%{_mavenpomdir}/JPP.%{name}-packaging.pom
+%{_javadir}/%{name}/packaging.jar
+
+%files -n %{name}-plugin
+%{_mavendepmapfragdir}/%{name}-plugin
+%{_mavenpomdir}/JPP.%{name}-plugin.pom
+%{_javadir}/%{name}/plugin.jar
+
+%changelog
+* Tue Sep 20 2011 Stanislav Ochotnicky <sochotnicky at redhat.com> - 2.1-2
+- Add depmap explanation
+- Omit javadoc.sh from javadocs
+- Add explicit maven NVR that is needed
+
+* Wed Sep 14 2011 Stanislav Ochotnicky <sochotnicky at redhat.com> - 2.1-1
+- Initial version of the package
diff --git a/sources b/sources
index e69de29..037314b 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+ce68217be882bdb491b9c9a2b36e0a80  maven-archetype-2.1-source-release.zip


More information about the java-sig-commits mailing list