Author: vsiveton
Date: Sat Jan 19 08:56:22 2008
New Revision: 613414
URL: http://svn.apache.org/viewvc?rev=613414&view=rev
Log:
MNG-2561: cookbook example: adding build time to a manifest
Submitted by: Brett Porter
Reviewed by: Vincent Siveton
o added the proposed example with some doc and more code
Added:
maven/sandbox/trunk/site/cookbook/generate-build-time/
maven/sandbox/trunk/site/cookbook/generate-build-time/README.TXT
maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml (with props)
maven/sandbox/trunk/site/cookbook/generate-build-time/src/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/app/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/app/App.java
(with props)
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/resources/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/resources/META-INF/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/resources/META-INF/MANIFEST.MF
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/app/
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/app/AppTest.java
(with props)
Added: maven/sandbox/trunk/site/cookbook/generate-build-time/README.TXT
URL:
http://svn.apache.org/viewvc/maven/sandbox/trunk/site/cookbook/generate-build-time/README.TXT?rev=613414&view=auto
==============================================================================
--- maven/sandbox/trunk/site/cookbook/generate-build-time/README.TXT (added)
+++ maven/sandbox/trunk/site/cookbook/generate-build-time/README.TXT Sat Jan 19
08:56:22 2008
@@ -0,0 +1,14 @@
+
+ Apache Maven Cookbook
+
+ What is it?
+ -----------
+
+ This project is a small complete working example Maven project that
+ demonstrates "How To Add Build Time To A JAR Manifest".
+
+ Documentation
+ -------------
+
+ The most up-to-date documentation can be found at
+
http://maven.apache.org/plugin-developers/cookbook/add-build-time-to-manifest.html.
Added: maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml
URL:
http://svn.apache.org/viewvc/maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml?rev=613414&view=auto
==============================================================================
--- maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml (added)
+++ maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml Sat Jan 19
08:56:22 2008
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.cookbook</groupId>
+ <artifactId>generate-build-time</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>Cookbook :: generate-build-time</name>
+ <description>Cookbook to add build time to a JAR Manifest</description>
+
+ <developers>
+ <developer>
+ <id>brett</id>
+ <name>Brett Porter</name>
+ <email>[EMAIL PROTECTED]</email>
+ <organization>ASF</organization>
+ <timezone>+10</timezone>
+ </developer>
+ <developer>
+ <id>vsiveton</id>
+ <name>Vincent Siveton</name>
+ <email>[EMAIL PROTECTED]</email>
+ <organization>ASF</organization>
+ <timezone>-5</timezone>
+ </developer>
+ </developers>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <!-- START SNIPPET: antrun -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <!-- Safety -->
+ <mkdir dir="${project.build.directory}"/>
+
+ <tstamp>
+ <format property="last.updated" pattern="yyyy-MM-dd
hh:mm:ss"/>
+ </tstamp>
+ <echo file="${basedir}/target/filter.properties"
message="build.time=${last.updated}"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- END SNIPPET: antrun -->
+ <!-- START SNIPPET: jar -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <useDefaultManifestFile>true</useDefaultManifestFile>
+ </configuration>
+ </plugin>
+ <!-- END SNIPPET: jar -->
+ </plugins>
+
+ <!-- START SNIPPET: pom -->
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
+ <filters>
+ <filter>${basedir}/target/filter.properties</filter>
+ </filters>
+ <!-- END SNIPPET: pom -->
+ </build>
+
+ <scm>
+
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/sandbox/site/cookbook/generate-build-time/</connection>
+
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/site/cookbook/generate-build-time/</developerConnection>
+
<url>http://svn.apache.org/viewcvs.cgi/maven/sandbox/site/cookbook/generate-build-time/</url>
+ </scm>
+</project>
Propchange: maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/sandbox/trunk/site/cookbook/generate-build-time/pom.xml
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/app/App.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/app/App.java?rev=613414&view=auto
==============================================================================
---
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/app/App.java
(added)
+++
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/app/App.java
Sat Jan 19 08:56:22 2008
@@ -0,0 +1,32 @@
+package org.apache.maven.cookbook.app;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Hello world!
+ *
+ */
+public class App
+{
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World!" );
+ }
+}
Propchange:
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/app/App.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/java/org/apache/maven/cookbook/app/App.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added:
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/resources/META-INF/MANIFEST.MF
URL:
http://svn.apache.org/viewvc/maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/resources/META-INF/MANIFEST.MF?rev=613414&view=auto
==============================================================================
---
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/resources/META-INF/MANIFEST.MF
(added)
+++
maven/sandbox/trunk/site/cookbook/generate-build-time/src/main/resources/META-INF/MANIFEST.MF
Sat Jan 19 08:56:22 2008
@@ -0,0 +1 @@
+Build-Time: ${build.time}
\ No newline at end of file
Added:
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/app/AppTest.java
URL:
http://svn.apache.org/viewvc/maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/app/AppTest.java?rev=613414&view=auto
==============================================================================
---
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/app/AppTest.java
(added)
+++
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/app/AppTest.java
Sat Jan 19 08:56:22 2008
@@ -0,0 +1,57 @@
+package org.apache.maven.cookbook.app;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Propchange:
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/app/AppTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/sandbox/trunk/site/cookbook/generate-build-time/src/test/java/org/apache/maven/cookbook/app/AppTest.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"