maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsm...@apache.org
Subject svn commit: r514202 - in /maven/sandbox/trunk/archetype/maven-archetype-quickstart: ./ src/main/resources/META-INF/ src/main/resources/archetype-resources/src/main/java/ src/main/resources/archetype-resources/src/main/resources/
Date Sat, 03 Mar 2007 17:35:45 GMT
Author: wsmoak
Date: Sat Mar  3 09:35:43 2007
New Revision: 514202

URL: http://svn.apache.org/viewvc?view=rev&rev=514202
Log:
Demonstrating problems with package name interpolation for non-Java resources.

Added:
    maven/sandbox/trunk/archetype/maven-archetype-quickstart/README.txt   (with props)
    maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/overview.html
  (with props)
    maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/package.html
  (with props)
    maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/resources/
    maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/resources/App.properties
  (with props)
Modified:
    maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/META-INF/archetype.xml

Added: maven/sandbox/trunk/archetype/maven-archetype-quickstart/README.txt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetype/maven-archetype-quickstart/README.txt?view=auto&rev=514202
==============================================================================
--- maven/sandbox/trunk/archetype/maven-archetype-quickstart/README.txt (added)
+++ maven/sandbox/trunk/archetype/maven-archetype-quickstart/README.txt Sat Mar  3 09:35:43
2007
@@ -0,0 +1,84 @@
+
+Sandbox :: Maven Quickstart Archetype
+=====================================
+
+Problem:  package name interpolation is not possible for non-Java resources
+
+In fixing this problem, we should retain the ability to *not* package
+non-Java resources.
+
+Observations:
+
+ * <resource> elements in the archetype descriptor are placed relative to
+ src/main/resources, not src/main/resources/[package]
+
+ * In prior versions of the archetype plugin, it was possible to list non-Java
+ resources under <sources> and have them "packaged". For example:
+ <source>src/main/resources/App.properties</source>
+
+ * Some non-Java files in src/main/java are simply ignored. Javadoc related
+ files such as package.html belong with the source code so that (by default)
+ they are not included in the jar.
+
+Demonstration:
+ 
+ This module contains the quickstart archetype with the following changes:
+
+ * Added package.html and overview.html for Javadocs.
+ * Added App.properties file
+ * Modified archetype.xml to include the new files
+ 
+ To try this example:
+
+ $ cd /path/to/maven/archetype
+ $ mvn install
+ 
+ $ cd /path/to/maven/sandbox/archetype/maven-archetype-quickstart
+ $ mvn install
+ 
+ $ cd /path/to/temp
+ $ mvn archetype:create -DgroupId=com.example -DartifactId=myproject
+       -DarchetypeVersion=1.1-SNAPSHOT
+       -DarchetypeGroupId=org.apache.maven.archetypes
+ 
+ (You may not need archetypeGroupId, I get an error without it.)
+ 
+ Result:
+
+With the following in archetype.xml:
+
+  <sources>
+    <source>src/main/java/App.java</source>
+    <source>src/main/java/package.html</source>
+    <source>src/main/resources/App.properties</source>
+  </sources>
+
+I get:
+
+[ERROR] BUILD ERROR
+[INFO] ---------------------------------------------------------------------
+[INFO] Error creating from archetype
+
+Embedded error: Error merging velocity templates
+Unable to find resource 'archetype-resources/src/main/java/package.html'
+
+If I comment out the line for package.html and rebuild the archetype, the error
+changes to:
+
+[ERROR] BUILD ERROR
+[INFO] ------------------------------------------------------------------------
+[INFO] Error creating from archetype
+
+Embedded error: Template 'src/main/resources/App.properties' not in directory 's
+rc/main/java'
+
+The only option is to move package.html and App.properties to the <resources> 
+section, but then they will not be placed into the proper package structure.
+
+I have also listed the overview.html file in archetype.xml:
+
+  <resources>
+    <resource>src/main/java/overview.html</resource>
+  </resources>
+
+This works, and places the overview.html file directly in src/main/java.

Propchange: maven/sandbox/trunk/archetype/maven-archetype-quickstart/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/archetype/maven-archetype-quickstart/README.txt
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/META-INF/archetype.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/META-INF/archetype.xml?view=diff&rev=514202&r1=514201&r2=514202
==============================================================================
--- maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/META-INF/archetype.xml
(original)
+++ maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/META-INF/archetype.xml
Sat Mar  3 09:35:43 2007
@@ -2,7 +2,12 @@
   <id>quickstart</id>
   <sources>
     <source>src/main/java/App.java</source>
+    <source>src/main/java/package.html</source>
+    <source>src/main/resources/App.properties</source>
   </sources>
+  <resources>
+    <resource>src/main/java/overview.html</resource>
+  </resources>
   <testSources>
     <source>src/test/java/AppTest.java</source>
   </testSources>

Added: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/overview.html
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/overview.html?view=auto&rev=514202
==============================================================================
--- maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/overview.html
(added)
+++ maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/overview.html
Sat Mar  3 09:35:43 2007
@@ -0,0 +1,9 @@
+
+<html>
+   <head>
+      <title>Project Overview</title>
+   </head>
+   <body>
+      <p>Overview of the project.</p>
+   </body>
+</html>

Propchange: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/overview.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/overview.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/package.html
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/package.html?view=auto&rev=514202
==============================================================================
--- maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/package.html
(added)
+++ maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/package.html
Sat Mar  3 09:35:43 2007
@@ -0,0 +1,3 @@
+<body>
+Description of the package.
+</body>

Propchange: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/java/package.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/resources/App.properties
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/resources/App.properties?view=auto&rev=514202
==============================================================================
--- maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/resources/App.properties
(added)
+++ maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/resources/App.properties
Sat Mar  3 09:35:43 2007
@@ -0,0 +1 @@
+abc=123

Propchange: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/resources/App.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/trunk/archetype/maven-archetype-quickstart/src/main/resources/archetype-resources/src/main/resources/App.properties
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL



Mime
View raw message