History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ARCHETYPE-89
Type: Bug Bug
Status: Closed Closed
Resolution: Incomplete
Priority: Major Major
Assignee: Raphaël Piéroni
Reporter: Brian Fox
Votes: 3
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven Archetype

archetypeng:create doesn't use configured repos to find artifacts

Created: 21/Aug/07 08:20 PM   Updated: 03/Jun/08 02:27 PM
Component/s: None
Affects Version/s: 2.0-alpha-2
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Related


 Description  « Hide
I deployed a snapshot of the archetype and create isn't finding it even though i have the maven-snapshot repo in my settings. A secondary problem is that if nothing is found, you get into an infinite loop where it asks you to pick a number that isn't there.
$ mvn.bat archetypeng:create
Using maven.home=c:\Program Files\maven2\bin\\..
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetypeng'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetypeng:create] (aggregator-style)
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing archetypeng:create
[INFO] [archetypeng:select-archetype]
Choose group:
1: org.apache.maven.archetypes
2: org.codehaus.mojo.archetypes
3: org.apache.maven.its
Choose a number:  (1/2/3): 3
[INFO] org.apache.maven.its: checking for updates from central
Choose archetype:
Choose a number: :


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Raphaël Piéroni - 27/Aug/07 01:17 PM
About the repositories in settings.
There is a maven issue (can remember which exactly) that state that
repositories defined in profiles in settings are not usable in a directory
that doesn't contain a pom. therefore the archetype plugin can't use it...

A workaround is usable: the archetype:add-repositories goal
that takes -DrepositoryId=central and -DrepositoryUrl=http://repo1.maven.org/maven2 properties
or -Drepositories=central=http://repo1.maven.org/maven2,company1=http://repo1.company.com property

About the infinite loop, It is a bug


Raphaël Piéroni - 27/Aug/07 05:12 PM
The loop behaviour is separated in ARCHETYPE-93

Brian Fox - 27/Aug/07 05:49 PM
I think you could read the settings.xml file directly to find the repositories? Having another goal is not ideal, we need this to be as easy as possible.

Raphaël Piéroni - 28/Aug/07 12:20 PM
About the 'other goal':

4 lists of configuration are located in the registry (~/.m2/archetype.xml);
They contain the groupIds, the repositories, the languages and the filtereds:

  • groupIds are used for prompting the user
  • repositories are used to retrieve the maven metadatas to propose the archetype and version selection
  • languages are directory names that contains 'packaged' sources and used during the create-from-project
  • filtered are file extensions that are used to separate velocity templates from binary files and used during create-from-project

Some goals are provided to administer the registry file.
There is add-Xs, remove-Xs, show-Xs for each of the 4 lists in the registry.
Of course one can still edit that file by hands

These mojos exist since late april but not documented

About the settings reading,

When i started, i used the repositories defined in the project, thinking the repositories defined in profiles in settings would be used. But they weren't.
I also desired to have the settings holds archetype groups like it holds the plugins groups. but it was too much change for the plugin only archetypeng was at this time.
I then decided to create the registry file to contains these 2 configuration lists. And when i wrote create-from-project, i used the registry to hold 2 more configuration lists. Hence the other goals.


Raphaël Piéroni - 04/Sep/07 01:23 PM
The issue MNG-3099 defines the repository part of this issue

Raphaël Piéroni - 21/Jan/08 12:40 PM
Changing issues to be fixed at next release

Brett Porter - 13/Feb/08 06:30 AM
all the data in this issue seems obsolete, but I have a different problem that would fall under the same description.

The repository URL should not be hardcoded into the internal catalog - it is looking at repo1, when really it should be looking at the repository defined by central (ie, the one in my settings file that points to my internal repository proxy). So, it needs to honour settings. I believe the catalog should specify and id and a url - and if the id exists use that instead (and if not, fall back to the URL).


Raphaël Piéroni - 03/Jun/08 02:17 PM
This issue is no longer accurate.
Brett, can you please create a new issue with your particular problem,
if this is still a problem. Thanks.

Brett Porter - 03/Jun/08 02:27 PM
created ARCHETYPE-179