Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-419

archetype:create-from-project create a pom.xml with package=maven-archetype but archetype:generate requires a package=jar

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Auto Closed
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: Creator, Generator
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              emeka Emeka Mosanya
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: