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

Multimodule archetype does not propagate the artifactId in module names.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-alpha-2
    • Fix Version/s: 2.0-alpha-3
    • Component/s: Creator, Generator
    • Labels:
      None

      Description

      Creating an archetype for a multimodule project,
      a test on the attached project creates the attached archetype
      using archetype:create-from-project.
      But when using the archetype, it raise an exception:

      mvn archetype:generate -DarchetypeCatalog=local
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'archetype'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Maven Default Project
      [INFO] task-segment: [archetype:generate] (aggregator-style)
      [INFO] ------------------------------------------------------------------------
      [INFO] Preparing archetype:generate
      [INFO] No goals needed for project - skipping
      [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
      [INFO] Setting property: velocimacro.messages.on => 'false'.
      [INFO] Setting property: resource.loader => 'classpath'.
      [INFO] Setting property: resource.manager.logwhenfound => 'false'.
      [INFO] [archetype:generate]
      Choose archetype:
      1: local -> project (project)
      2: local -> basic-multi-archetype (basic-multi-archetype)
      3: local -> maven-integration-test-sample (maven-integration-test-sample)
      4: local -> maven-integration-test-sample-archetype (maven-integration-test-sample-archetype)
      5: local -> proficio (proficio)
      Choose a number: (1/2/3/4/5): 5
      Define value for groupId: : org.community
      Define value for artifactId: : pro
      Define value for version: : 2.0-SNAPSHOT
      Define value for package: : org.community.pro
      Confirm properties configuration:
      groupId: org.community
      artifactId: pro
      version: 2.0-SNAPSHOT
      package: org.community.pro
      Y: :
      [ERROR] ResourceManager : unable to find resource 'archetype-resources/pro-api/pom.xml' in any resource loader.
      [ERROR] org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Unable to find resource 'archetype-resources/pro-api/pom.xml'
      org.apache.maven.archetype.exception.ArchetypeGenerationFailure: org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Unable to find resource 'archetype-resources/pro-api/pom.xml'
      at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:240)
      at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processFileSetArchetype(DefaultArchetypeGenerator.java:215)
      at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:130)
      at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:290)
      at org.apache.maven.archetype.DefaultArchetype.generateProjectFromArchetype(DefaultArchetype.java:75)
      at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:165)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:224)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Unable to find resource 'archetype-resources/pro-api/pom.xml'
      at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplate(DefaultFilesetArchetypeGenerator.java:745)
      at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processPomWithParent(DefaultFilesetArchetypeGenerator.java:678)
      at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetProject(DefaultFilesetArchetypeGenerator.java:584)
      at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetModule(DefaultFilesetArchetypeGenerator.java:511)
      at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetModule(DefaultFilesetArchetypeGenerator.java:542)
      at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:206)
      ... 23 more
      Caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'archetype-resources/pro-api/pom.xml'
      at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:452)
      at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
      at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
      at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
      at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplate(DefaultFilesetArchetypeGenerator.java:739)
      ... 28 more
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 35 seconds
      [INFO] Finished at: Mon Mar 24 21:34:57 GMT 2008
      [INFO] Final Memory: 11M/29M
      [INFO] ------------------------------------------------------------------------

        Attachments

        1. archetype.tgz
          1 kB
          Raphaël Luta
        2. project.tgz
          0.9 kB
          Raphaël Luta

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              raphael Raphaël Luta
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: