Community
Participate
Working Groups
Build Identifier: 20110916-0149 When you try to create a project from an archetype existing only in the local repository, ArchetypeArtifactManager.isFileSetArchetype(...) always returns false, due to un underlying artifact resolution exception : Caused by: java.lang.NullPointerException: null at org.sonatype.aether.impl.internal.DefaultMetadataResolver.resolve(DefaultMetadataResolver.java:283) ~[aether-impl-1.11.jar:na] at org.sonatype.aether.impl.internal.DefaultMetadataResolver.resolveMetadata(DefaultMetadataResolver.java:177) ~[aether-impl-1.11.jar:na] at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:211) ~[maven-aether-provider-3.0.3.jar:3.0.3] at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:276) ~[aether-impl-1.11.jar:na] at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:220) ~[aether-impl-1.11.jar:na] at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:197) ~[aether-impl-1.11.jar:na] at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:323) ~[aether-impl-1.11.jar:na] at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:213) ~[maven-compat-3.0.3.jar:3.0.3] at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:157) ~[maven-compat-3.0.3.jar:3.0.3] at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:525) ~[maven-compat-3.0.3.jar:3.0.3] at org.apache.maven.archetype.downloader.DefaultDownloader.download(DefaultDownloader.java:55) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.getArchetypeFile(DefaultArchetypeArtifactManager.java:98) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.isFileSetArchetype(DefaultArchetypeArtifactManager.java:227) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypeParametersPage$9.run(MavenProjectWizardArchetypeParametersPage.java:397) ~[org.eclipse.m2e.core.ui_1.0.100.20110804-1717.jar:na] at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) ~[org.eclipse.jface_3.7.0.I20110522-1430.jar:na] Since the archetype is not resolved, The Properties table from MavenProjectWizardArchetypeParametersPage is not populated with the archetype required properties. Ultimately, project creation fails because of these missing required properties. Note that, sometimes, the properties table get filled up, after creating a few projects, while switching archetypes. It seems it's caused by the call to setArchetype() (if archetype has changed, properties table is re-populated) Reproducible: Always Steps to Reproduce: 1. unzip and install the attached archetype (someproject-archetype) 2. in m2e, create a new maven project 3. choose someproject-archetype in the default local catalog (use snapshots) 4. click next 5. Assert the property "name" having the value "my project" is displayed <- fails
Created attachment 204516 [details] Archetype to unzip and install in the local repo
*** Bug 385273 has been marked as a duplicate of this bug. ***
Fixed with http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=052c1ee493b0c6be9738166442501f605a3bd45c. Highlight of the fix is calling LegacySupport to provide a proper maven session to the archetyper resolver. Using the actual remote repo of the archetype, properly configured, also fixes bug 371775. Tests : https://github.com/sonatype/m2e-core-tests/commit/1ba7b2efc09da1a882d6356d40edbab2063ae33a
Moved to https://github.com/eclipse-m2e/m2e-core/issues/