You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jesse Glick (JIRA)" <ji...@codehaus.org> on 2010/10/08 15:30:32 UTC

[jira] Created: (ARCHETYPE-335) Make 'package' be a required property for archetypes that need it

Make 'package' be a required property for archetypes that need it
-----------------------------------------------------------------

                 Key: ARCHETYPE-335
                 URL: http://jira.codehaus.org/browse/ARCHETYPE-335
             Project: Maven Archetype
          Issue Type: Improvement
    Affects Versions: 2.0-alpha-5
            Reporter: Jesse Glick


The 'package' parameter makes sense only for archetypes which actually create a project with source files written in Java or another JVM language. It is unnecessary for Java-oriented archetypes which do not create any source files (just set up the POM). It is nonsensical for org.codehaus.mojo.archetypes:pom-root, or for archetypes based on scripting languages that do not generally use hierarchical namespaces, etc.

Since it is assumed that all archetypes might use this parameter, UIs such as an IDE creating projects from archetype are forced to ask for a package name whether or not it will be used, which is confusing. (Is there an official way to tell in advance whether a given archetype will make use of a package name that works across the various metadata formats? If there is, maven-archetype-plugin's own CLI UI does not seem to make use of it.)

Consider making this a regular required property for those archetypes which actually need to define a package, such as quickstart. This would be more general and language-neutral. (In fact, an archetype could request more than one package name for different purposes; or a C# archetype could call it "namespace".) Velocity scripts for the actual source files should not need any change; the fileset definition would need to accommodate the possibility of a file from archetype-resources being placed in a different location based on the value of some parameter, e.g.

{noformat}
<fileSet filtered="true">
  <directory>src/main/java</directory>
  <target>src/main/java/${package.replace('.', '/')}</target>
</fileSet>
<requiredProperties>
  <requiredProperty key="package"/>
</requiredProperties>
{noformat}

with packaged="true" being deprecated.

BTW: http://maven.apache.org/archetype/maven-archetype-plugin/generate-mojo.html makes no mention of the 'package' parameter, or indeed of several other parameters which are interpreted. http://maven.apache.org/archetype/maven-archetype-plugin/create-mojo.html does mention them.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira