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

Maven archetype:generate does not find local archetypes in interactive mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.1
    • None
    • None
    • None
    • Apache Maven 3.5.0
      Archetype Plugin 3.0.1
      JDK 8
      mac OS Sierra

    Description

      Hi there,

      I have seen other tickets namely ARCHETYPE-519 and ARCHETYPE-528. This might be related. I am not on the dev or user list so I am not sure if this has been discussed. If so, feel free to close this issue, no harm done.

      tl;dr: Maven 3.5.0 uses maven-archetype-plugin:2.4 and does not find archetypes created with plugin version 3.0.1 in local repository in interactive mode.

      We created a Maven archetype for projects with the goal archetype:create-from-project. This went smooth and I can do a mvn install in the archetype projects folder. I can verify that there is an entry in ~/.m2/repository/archetype-catalog.xml

      Since this is for internal use we didn't plan to upload the archetype to a repository. Developers should simply checkout the archetype project folder and do a mvn install.

      While in the archetypes project folder I can see the archetype with mvn archetype:generate. I guess this is because there is a pom.xml in the directory which declares version 3.0.1 in the plugins section.

      Now, if go to a different directory and try to generate a quickstart project with mvn archetype:generate the local archetype is missing. However it works in non-interactive mode.

      mvn archetype:generate 
          -DarchetypeCatalog=local 
          -DarchetypeGroupId=<archetypeGroupId> 
          -DarchetypeArtifactId=<archetypeArtifactId>
          ...
          -DinteractiveMode=false
      

      This creates a project based on the archetype but issues a warning during the process.

      [WARNING] Archetype not found in any catalog. Falling back to central repository (http://repo.maven.apache.org/maven2).
      [WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
      

      Maven 3.5.0 still uses the 2.4 version of the archetype plugin.

      Attachments

        Activity

          People

            Unassigned Unassigned
            raupach Björn Raupach
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: