Maven Archetype

archetype plugin doesn't use private plugin repository configured in <MAVEN-HOME>/conf/settings.xml

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-alpha-4
  • Fix Version/s: None
  • Component/s: Archetypes
  • Labels:
    None
  • Environment:
    windows xp
    jdk 1.5.0_09-b01
  • Number of attachments :
    0

Description

I configured the file <Maven-Home>/conf/settings to use a local, private plugin repository to prevent uncontrolled download from the official central repository at http://repo1.maven.org/maven2. This works fine except in the case I call the archetype plugin (archetype:create). In this case the settings.xml is ignored and all plugins are downloaded from the central repository at maven.org.

I observed the same when calling mvn help:active-profiles in a directory that doesn't contain a pom.xml file.
If I place a dummy pom.xml file in this directory the settings.xml are used and everything is fine. But if I use this trick with the archetype plugin the newly created project (creation via archetype) is configured as a child of my dummy pom (pom.xml contains parent section with dummy pom). I the case of a dummy pom this is not intended.

So i would be nice if you can fix the archtype plugin to use the configured settings.xml. I really would like to use this plugin, because it would help a lot to standardize a common project layout for our developers. This is a majour reason for choosing maven2.

Greetings,
Martin

Here is the relevant section of my settings.xml:

...
<profiles>
<profile>
<!-- profile for using private plugin and 3rd party repositories -->
<id>private-repo</id>
<pluginRepositories>
<pluginRepository>
<!-- repository contains all maven-plugins required to run our build -->
<id>central</id>
<name>private plugin repository</name>
<url>http://localserver/mvn-repos/maven-plugin</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<activeProfiles>
<activeProfile>private-repo</activeProfile>
</activeProfiles>
...

Issue Links

Activity

Hide
Nelz added a comment -

FYI, this is still happening for me.

WinXP Pro, JDK 1.5.0_11, Maven 2.0.7
Ubuntu 7.04, JDK 1.6.0.00

I saw some traffic on http://jira.codehaus.org/browse/MNG-3099 that this might have been solved in 2.0.7, but I am living proof that it is not...

Show
Nelz added a comment - FYI, this is still happening for me. WinXP Pro, JDK 1.5.0_11, Maven 2.0.7 Ubuntu 7.04, JDK 1.6.0.00 I saw some traffic on http://jira.codehaus.org/browse/MNG-3099 that this might have been solved in 2.0.7, but I am living proof that it is not...
Hide
Nick Padgett added a comment -

Do you have Windows setup to hide common file extentions? Open up a command line tool and go to %USER_HOME%\.m2 and list the contents of the directory. I suspect the file may be named settings.xml.txt when it should be named settings.xml.

  • Nick
Show
Nick Padgett added a comment - Do you have Windows setup to hide common file extentions? Open up a command line tool and go to %USER_HOME%\.m2 and list the contents of the directory. I suspect the file may be named settings.xml.txt when it should be named settings.xml.
  • Nick
Hide
William Ferguson added a comment -

The workaround for this is to specify a 'remoteRepositories' property on the command line pointing to your internal Repository. Eg

mvn archetype:create -DgroupId=com.yarris -DartifactId=foo-project -DarchetypeGroupId=com.yarris.maven -DarchetypeArtifactId=archetype-standard -DremoteRepositories=http://zosma.oz.hubbub.com.au:8080/proximity/repository/release

This issues appears to be a duplicate of :
http://jira.codehaus.org/browse/ARCHETYPE-1
http://jira.codehaus.org/browse/ARCHETYPE-81

What I don't understand is that
http://jira.codehaus.org/browse/ARCHETYPE-1
is marked as closed fixed (with no version), but the issue still clearly exists in maven-2.0.7, maven-archetype-1.0-alpha-4

Without a real fix for this issue creating projects using archetypes is not really viable.
Ie it becomes almost as easy to copy and paste an existing project and modify ts details that to use an archetype.
Which is what I thought we are trying to get away from.

Show
William Ferguson added a comment - The workaround for this is to specify a 'remoteRepositories' property on the command line pointing to your internal Repository. Eg mvn archetype:create -DgroupId=com.yarris -DartifactId=foo-project -DarchetypeGroupId=com.yarris.maven -DarchetypeArtifactId=archetype-standard -DremoteRepositories=http://zosma.oz.hubbub.com.au:8080/proximity/repository/release This issues appears to be a duplicate of : http://jira.codehaus.org/browse/ARCHETYPE-1 http://jira.codehaus.org/browse/ARCHETYPE-81 What I don't understand is that http://jira.codehaus.org/browse/ARCHETYPE-1 is marked as closed fixed (with no version), but the issue still clearly exists in maven-2.0.7, maven-archetype-1.0-alpha-4 Without a real fix for this issue creating projects using archetypes is not really viable. Ie it becomes almost as easy to copy and paste an existing project and modify ts details that to use an archetype. Which is what I thought we are trying to get away from.
Hide
Bouiaw added a comment -

Is there someone who maintain archetype plugin ? This bug simply make archetype plugin unusable for everyone !!!

Show
Bouiaw added a comment - Is there someone who maintain archetype plugin ? This bug simply make archetype plugin unusable for everyone !!!
Hide
Bouiaw added a comment -

This issue is fixed with Maven 2.0.9-RC5 + Archetype plugin 2.0-alpha-3-SNAPSHOT. Release is expected shortly for both !!!

Show
Bouiaw added a comment - This issue is fixed with Maven 2.0.9-RC5 + Archetype plugin 2.0-alpha-3-SNAPSHOT. Release is expected shortly for both !!!
Hide
Raphaël Piéroni added a comment -

Closed as from user comment (bouiaw).
Please reopen with up to date information if this issue still appear in latest version of the archetype plugin

Show
Raphaël Piéroni added a comment - Closed as from user comment (bouiaw). Please reopen with up to date information if this issue still appear in latest version of the archetype plugin

People

Vote (14)
Watch (10)

Dates

  • Created:
    Updated:
    Resolved: