Re: How to create a new Struts2 project with maven2?

View: New views
4 Messages — Rating Filter:   Alert me  

Re: How to create a new Struts2 project with maven2?

by Thai Dang Vu-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I tried what you suggested, but still got error:

 mvn -e archetype:create -DgroupId=home.struts2 -DartifactId=struts2-example -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.11 -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository
+ Error stacktraces are turned on.
[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.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[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 'VM_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  global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: home.struts2
[INFO] We are using command line specified remote repositories: http://people.apache.org/builds/struts/m2-staging-repository
Downloading: http://people.apache.org/builds/struts/m2-staging-repository/org/apache/struts/struts2-archetype-starter/2.0.11/struts2-archetype-starter-2.0.11.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating from archetype

Embedded error: Archetype does not exist.
Unable to download the artifact from any repository
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error creating from archetype
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
        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.plugin.MojoExecutionException: Error creating from archetype
        at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:229)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        ... 16 more
Caused by: org.apache.maven.archetype.ArchetypeNotFoundException: Archetype does not exist.
        at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:130)
        at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:224)
        ... 18 more
Caused by: org.apache.maven.shared.downloader.DownloadNotFoundException: Requested download does not exist.
        at org.apache.maven.shared.downloader.DefaultDownloader.download(DefaultDownloader.java:62)
        at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:121)
        ... 19 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
    mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Hi,

mvn archetype:create -DgroupId=com.s2.anu -DartifactId=s2proj
-DarchetypeGroupId=org.apache.struts-DarchetypeArtifactId=struts2-archetype-starter
-DarchetypeVersion=
2.0.11 -DremoteRepositories=
http://people.apache.org/builds/struts/m2-staging-repository

why dont you try this. i think this might work.

Thanks,

Nuwan
(http://code.google.com/p/struts2-ssl-plugin/)



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Re: How to create a new Struts2 project with maven2?

by nuwan chandrasoma-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

The command i have given to you work for me, i dont know what is wrong
here.. any maven guru can help you on this.

Thanks,

Nuwan
(http://code.google.com/p/struts2-ssl-plugin/)

Thai Dang Vu wrote:

> I tried what you suggested, but still got error:
>
>  mvn -e archetype:create -DgroupId=home.struts2 -DartifactId=struts2-example -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.11 -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository
> + Error stacktraces are turned on.
> [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.properties
> [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
> [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
> [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 'VM_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  global in scope if allowed.
> [INFO] Velocimacro : initialization complete.
> [INFO] Velocity successfully started.
> [INFO] [archetype:create]
> [INFO] Defaulting package to group ID: home.struts2
> [INFO] We are using command line specified remote repositories: http://people.apache.org/builds/struts/m2-staging-repository
> Downloading: http://people.apache.org/builds/struts/m2-staging-repository/org/apache/struts/struts2-archetype-starter/2.0.11/struts2-archetype-starter-2.0.11.jar
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error creating from archetype
>
> Embedded error: Archetype does not exist.
> Unable to download the artifact from any repository
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error creating from archetype
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
>         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.plugin.MojoExecutionException: Error creating from archetype
>         at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:229)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
>         ... 16 more
> Caused by: org.apache.maven.archetype.ArchetypeNotFoundException: Archetype does not exist.
>         at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:130)
>         at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:224)
>         ... 18 more
> Caused by: org.apache.maven.shared.downloader.DownloadNotFoundException: Requested download does not exist.
>         at org.apache.maven.shared.downloader.DefaultDownloader.download(DefaultDownloader.java:62)
>         at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:121)
>         ... 19 more
> Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
>     mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file
>
> Alternatively, if you host your own repository you can deploy the file there:
>     mvn deploy:deploy-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>
> Hi,
>
> mvn archetype:create -DgroupId=com.s2.anu -DartifactId=s2proj
> -DarchetypeGroupId=org.apache.struts-DarchetypeArtifactId=struts2-archetype-starter
> -DarchetypeVersion=
> 2.0.11 -DremoteRepositories=
> http://people.apache.org/builds/struts/m2-staging-repository
>
> why dont you try this. i think this might work.
>
> Thanks,
>
> Nuwan
> (http://code.google.com/p/struts2-ssl-plugin/)
>
>
>
>       ____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: How to create a new Struts2 project with maven2?

by Laurie Harper :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It works fine for me too. Maybe it's a problem with the version of Maven
you're using?

[laurie@squibble]$ mvn --version
Maven version: 2.0.6
[laurie@squibble]$ mvn archetype:create -DgroupId=home.struts2
-DartifactId=struts2-example -DarchetypeGroupId=org.apache.struts
-DarchetypeArtifactId=struts2-archetype-starter
-DarchetypeVersion=2.0.11
-DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository
[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.properties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[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 'VM_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  global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: home.struts2
[INFO] We are using command line specified remote repositories:
http://people.apache.org/builds/struts/m2-staging-repository
[INFO]
----------------------------------------------------------------------------
[INFO] Using following parameters for creating Archetype:
struts2-archetype-starter:2.0.11
[INFO]
----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: home.struts2
[INFO] Parameter: packageName, Value: home.struts2
[INFO] Parameter: basedir, Value: /Users/laurie/tmp/x
[INFO] Parameter: package, Value: home.struts2
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: struts2-example
[INFO] ********************* End of debug info from resources from
generated POM ***********************
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
reference : template =
archetype-resources/src/main/java/HelloWorldAction.java [line 2,column
4] : $Id is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
reference : template =
archetype-resources/src/main/java/IndexAction.java [line 2,column 4] :
$Id is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
reference : template =
archetype-resources/src/main/java/DateConverter.java [line 2,column 4] :
$Id is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
reference : template =
archetype-resources/src/main/webapp/WEB-INF/sitemesh.xml [line 5,column
21] : ${decorators-file} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
reference : template =
archetype-resources/src/main/webapp/WEB-INF/sitemesh.xml [line 45,column
41] : ${decorators-file} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
reference : template =
archetype-resources/src/test/java/HelloWorldActionTest.java [line
2,column 4] : $Id is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException:
reference : template =
archetype-resources/src/test/java/IndexActionTest.java [line 2,column 4]
: $Id is not a valid reference.
[INFO] Archetype created in dir: /Users/laurie/tmp/x/struts2-example
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Sat Feb 02 12:39:44 EST 2008
[INFO] Final Memory: 5M/9M
[INFO]
------------------------------------------------------------------------

Nuwan Chandrasoma wrote:

> Hi,
>
> The command i have given to you work for me, i dont know what is wrong
> here.. any maven guru can help you on this.
>
> Thanks,
>
> Nuwan
> (http://code.google.com/p/struts2-ssl-plugin/)
>
> Thai Dang Vu wrote:
>> I tried what you suggested, but still got error:
>>
>>  mvn -e archetype:create -DgroupId=home.struts2
>> -DartifactId=struts2-example -DarchetypeGroupId=org.apache.struts
>> -DarchetypeArtifactId=struts2-archetype-starter
>> -DarchetypeVersion=2.0.11
>> -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository 
>>
>> + Error stacktraces are turned on.
>> [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.properties
>> [INFO] Default ResourceManager initializing. (class
>> org.apache.velocity.runtime.resource.ResourceManagerImpl)
>> [INFO] Resource Loader Instantiated:
>> org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
>> [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 'VM_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  global in scope if allowed.
>> [INFO] Velocimacro : initialization complete.
>> [INFO] Velocity successfully started.
>> [INFO] [archetype:create]
>> [INFO] Defaulting package to group ID: home.struts2
>> [INFO] We are using command line specified remote repositories:
>> http://people.apache.org/builds/struts/m2-staging-repository
>> Downloading:
>> http://people.apache.org/builds/struts/m2-staging-repository/org/apache/struts/struts2-archetype-starter/2.0.11/struts2-archetype-starter-2.0.11.jar 
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Error creating from archetype
>>
>> Embedded error: Archetype does not exist.
>> Unable to download the artifact from any repository
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: Error creating
>> from archetype
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
>>
>>         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.plugin.MojoExecutionException: Error
>> creating from archetype
>>         at
>> org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:229)
>>
>>         at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
>>
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
>>
>>         ... 16 more
>> Caused by: org.apache.maven.archetype.ArchetypeNotFoundException:
>> Archetype does not exist.
>>         at
>> org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:130)
>>
>>         at
>> org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:224)
>>
>>         ... 18 more
>> Caused by:
>> org.apache.maven.shared.downloader.DownloadNotFoundException:
>> Requested download does not exist.
>>         at
>> org.apache.maven.shared.downloader.DefaultDownloader.download(DefaultDownloader.java:62)
>>
>>         at
>> org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:121)
>>
>>         ... 19 more
>> Caused by:
>> org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable
>> to download the artifact from any repository
>>
>> Try downloading the file manually from the project website.
>>
>> Then, install it using the command:     mvn install:install-file
>> -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter
>> -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file
>>
>> Alternatively, if you host your own repository you can deploy the file
>> there:     mvn deploy:deploy-file -DgroupId=org.apache.struts
>> -DartifactId=struts2-archetype-starter -Dversion=2.0.11
>> -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>>
>> Hi,
>>
>> mvn archetype:create -DgroupId=com.s2.anu -DartifactId=s2proj
>> -DarchetypeGroupId=org.apache.struts-DarchetypeArtifactId=struts2-archetype-starter
>>
>> -DarchetypeVersion=
>> 2.0.11 -DremoteRepositories=
>> http://people.apache.org/builds/struts/m2-staging-repository
>>
>> why dont you try this. i think this might work.
>>
>> Thanks,
>>
>> Nuwan
>> (http://code.google.com/p/struts2-ssl-plugin/)
>>
>>
>>
>>      
>> ____________________________________________________________________________________
>>
>> Looking for last minute shopping deals?  Find them fast with Yahoo!
>> Search.  
>> http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>>  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: How to create a new Struts2 project with maven2?

by Makrand :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To fix this error , here is the attached JAR file which you can upload using mvn install file..
Thai Dang Vu-4 wrote:
I tried what you suggested, but still got error:

 mvn -e archetype:create -DgroupId=home.struts2 -DartifactId=struts2-example -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.11 -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository
+ Error stacktraces are turned on.
[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.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[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 'VM_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  global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: home.struts2
[INFO] We are using command line specified remote repositories: http://people.apache.org/builds/struts/m2-staging-repository
Downloading: http://people.apache.org/builds/struts/m2-staging-repository/org/apache/struts/struts2-archetype-starter/2.0.11/struts2-archetype-starter-2.0.11.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating from archetype

Embedded error: Archetype does not exist.
Unable to download the artifact from any repository
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error creating from archetype
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
        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.plugin.MojoExecutionException: Error creating from archetype
        at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:229)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        ... 16 more
Caused by: org.apache.maven.archetype.ArchetypeNotFoundException: Archetype does not exist.
        at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:130)
        at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:224)
        ... 18 more
Caused by: org.apache.maven.shared.downloader.DownloadNotFoundException: Requested download does not exist.
        at org.apache.maven.shared.downloader.DefaultDownloader.download(DefaultDownloader.java:62)
        at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:121)
        ... 19 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
    mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
    mvn deploy:deploy-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Hi,

mvn archetype:create -DgroupId=com.s2.anu -DartifactId=s2proj
-DarchetypeGroupId=org.apache.struts-DarchetypeArtifactId=struts2-archetype-starter
-DarchetypeVersion=
2.0.11 -DremoteRepositories=
http://people.apache.org/builds/struts/m2-staging-repository

why dont you try this. i think this might work.

Thanks,

Nuwan
(http://code.google.com/p/struts2-ssl-plugin/)



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
struts2-archetype-starter-2.0.9-SNAPSHOT.jar