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
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.