You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Erik Weibust <er...@weibust.net> on 2007/07/12 23:31:38 UTC

problem with archetype

I'm trying to use a simple archetype command and getting an unexpected error.

When I run: mvn archetype:create -DgroupId=com.mycompany.app
-DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp

I get the error listed below.  I don't understand why I would get an error
message asking me to install an artifact for a fairly standard Maven
archetype.  I assumed these were all hosted in a public repo.

Thanks for any help on the problem,

Erik Weibust


[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO]
-------------------------------------------------------------------------
---
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:create] (aggregator-style)
[INFO]
-------------------------------------------------------------------------
---
[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] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File:
org\apache\velocity\runtime\defaults\velocity.pr
operties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.
resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLo
aderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.
ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template :
VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm'
in any
resource loader.
[INFO] Velocimacro : error using  VM library template VM_global_library.vm
: org
.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'V
M_global_library.vm'
[INFO] Velocimacro :  VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in
templates

[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline
may NOT
replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be
 glob
al in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: com.mycompany.app
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.maven.archetypes
ArtifactId: maven-archetype-webapp
Version: RELEASE

Reason: Unable to determine the release version

Try downloading the file manually from the project website.

Then, install it using the command:
    mvn install:install-file -DgroupId=org.apache.maven.archetypes
-DartifactId=
maven-archetype-webapp \
        -Dversion=RELEASE -Dpackaging=jar -Dfile=/path/to/file


  org.apache.maven.archetypes:maven-archetype-webapp:jar:RELEASE



[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Jul 12 17:28:28 EDT 2007
[INFO] Final Memory: 4M/8M
[INFO]
------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problem with archetype

Posted by Erik Weibust <er...@weibust.net>.
Yes, go for it.

Erik

>
> Wendy, Erik,
>
> Looks like we saw http://jira.codehaus.org/browse/MNG-916 given that the
> version gets resolved to RELEASE.
>
> This is the most prevalent bugger I've seen on Maven, sort of grown to
> live
> with it by nuking bits of my local repository every now and then.
>
> Shall we re-open it?
>
> Alex
> --
> View this message in context:
> http://www.nabble.com/problem-with-archetype-tf4070979s177.html#a11586585
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problem with archetype

Posted by Alex Mayorga Adame <al...@yahoo.com>.
Wendy, Erik,

Looks like we saw http://jira.codehaus.org/browse/MNG-916 given that the
version gets resolved to RELEASE.

This is the most prevalent bugger I've seen on Maven, sort of grown to live
with it by nuking bits of my local repository every now and then.

Shall we re-open it?

Alex
-- 
View this message in context: http://www.nabble.com/problem-with-archetype-tf4070979s177.html#a11586585
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problem with archetype

Posted by Wendy Smoak <ws...@gmail.com>.
On 7/13/07, Erik Weibust <er...@weibust.net> wrote:

> I'm back in business.  The strange thing is that I didn't have to delete
> anything from my repo and the archetype just worked today.?.?

The default repository update policy is 'daily'.  If it fails once,
Maven won't check a given repository for a given artifact again until
the next day.

You can override this with -U on the command line, or by deleting the
metadata from your local repository.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problem with archetype

Posted by Erik Weibust <er...@weibust.net>.
Thanks Alex...

I'm back in business.  The strange thing is that I didn't have to delete
anything from my repo and the archetype just worked today.?.?

How could something get corrupted like you described?

Erik

> I had this bugger bite me during an "Evangelizing session" just yesterday
> at
> around the time you posted this (mine involved the quickstart archetype
> thought).
>
> I was also behind a proxy there. But the problem was that the archetypes
> metadata got corrupted somehow. Go check
> ${user.home}/.m2/repository/org/apache/maven/archetypes/maven-archetype-webapp/maven-*.xml
>
> If you see something like this:
>
> <?xml version="1.0" encoding="UTF-8"?><metadata>
>   <groupId>org.apache.maven.archetypes</groupId>
>   <artifactId>maven-archetype-webapp</artifactId>
>   <version>1.0-alpha-4</version>
> </metadata>
> with missing <versioning> then we saw the same bugger.
>
> Just nuke the
> ${user.home}/.m2/repository/org/apache/maven/archetypes/maven-archetype-webapp
> folder from your local repository and try again.
>
> I've just tried your command behind the corporate proxy here and it
> succeeded.
>
> My 2¢,
> Alex
> --
> View this message in context:
> http://www.nabble.com/problem-with-archetype-tf4070979s177.html#a11582912
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problem with archetype

Posted by Alex Mayorga Adame <al...@yahoo.com>.
I had this bugger bite me during an "Evangelizing session" just yesterday at
around the time you posted this (mine involved the quickstart archetype
thought).

I was also behind a proxy there. But the problem was that the archetypes
metadata got corrupted somehow. Go check
${user.home}/.m2/repository/org/apache/maven/archetypes/maven-archetype-webapp/maven-*.xml

If you see something like this:

<?xml version="1.0" encoding="UTF-8"?><metadata>
  <groupId>org.apache.maven.archetypes</groupId>
  <artifactId>maven-archetype-webapp</artifactId>
  <version>1.0-alpha-4</version>
</metadata>
with missing <versioning> then we saw the same bugger.

Just nuke the
${user.home}/.m2/repository/org/apache/maven/archetypes/maven-archetype-webapp
folder from your local repository and try again.

I've just tried your command behind the corporate proxy here and it
succeeded.

My 2¢,
Alex
-- 
View this message in context: http://www.nabble.com/problem-with-archetype-tf4070979s177.html#a11582912
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problem with archetype

Posted by Erik Weibust <er...@weibust.net>.
> Are you behind a firewall and have to use a proxy to access the central
> repo?

You guessed it.  I'm sitting here in a large company, behind an ugly
firewall/proxy.

> If yes: The Archetype plugin has a bug and ignores any proxy
> settings you have configured in your settings.xml unless there's a pom.xml
> in the directory in which you execute mvn...

Seems strange that I'm trying to use an archetype to create my maven
project structure and pom, and I need to provide a pom to get the
archetype to work.

Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: problem with archetype

Posted by Thorsten Heit <th...@gmx.de>.
Hi Erik,

> I'm trying to use a simple archetype command and getting an unexpected
> error.
> 
> When I run: mvn archetype:create -DgroupId=com.mycompany.app
> -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp
> 
> I get the error listed below.  I don't understand why I would get an error
> message asking me to install an artifact for a fairly standard Maven
> archetype.  I assumed these were all hosted in a public repo.

Are you behind a firewall and have to use a proxy to access the central repo? If yes: The Archetype plugin has a bug and ignores any proxy settings you have configured in your settings.xml unless there's a pom.xml in the directory in which you execute mvn...


Regards

Thorsten

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org