Emeka Mosanya created ARCHETYPE-419:
---------------------------------------

             Summary: archetype:create-from-project create a pom.xml with 
package=maven-archetype but archetype:generate requires a package=jar
                 Key: ARCHETYPE-419
                 URL: https://jira.codehaus.org/browse/ARCHETYPE-419
             Project: Maven Archetype
          Issue Type: Bug
          Components: Creator, Generator
    Affects Versions: 2.2
            Reporter: Emeka Mosanya
            Priority: Minor


FilesetArchetypeCreator.createArchetypeProjectPom hardcodes the project 
packaging to "maven-archetype" which is fine.

Unfortunately, the DefaultDownloader which downloads the archetype during the 
create-from-project goal is searching for an archetype with a "jar" packaging.

Therefore, you cannot directly generate a new project using archetype:generate 
from a freshly created archetype since generate will not find it.

The integration test works fine since it uses the artifact just built under 
target and which is a jar package but if you add the 

<archetypePostPhase>install</archetypePostPhase>

property to the create-from-project goals, the package will be installed in the 
local repository with a package maven-archetype like this:

Installing 
/Users/ft/falcon/ftcloud-git/services/smokeapp/smokeappService/target/generated-sources/archetype/target/smokeapp-service-archetype-0.15.0-SNAPSHOT.jar
 to 
/Users/ft/.m2/repository/com/ft/smokeapp-service-archetype/0.15.0-SNAPSHOT/smokeapp-service-archetype-0.15.0-SNAPSHOT.maven-archetype

I think that the downloader should search for a 'maven-archetype' package and 
not a jar package or we should make the parameter configurable.

My rational is the following: I would like to avoid copying the created 
archetype in my source directory but instead keep it as a result of the build 
process and directly install/deploy it.  This is to avoid code duplication and 
ensure that the archetype is always in sync with the originating project.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to