This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Learning Struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Learning Struts 2" Watch "Learning Struts 2" New topic
Author

Learning Struts 2

Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Hi All,


I have worked with Struts 1.x for last two years and I know it well. I want to learn Struts 2.0.


I tried Bootstrap tutorial on struts site (http://struts.apache.org/2.x/docs/ready-set-go.html).

But first Maven command did not work. I am new to Maven as well. I have used Ant in the past.


I tried executing


mvn archetype:create -DgroupId=tutorial -DartifactId=tutorial -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.9-SNAPSHOT -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository



in one blank directory and expected it that it will create application template which is mentioned on strut's site.

But it giving me following errors.




[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18 seconds
[INFO] Finished at: Fri Sep 05 18:43:49 GMT+05:30 2008
[INFO] Final Memory: 1M/2M
[INFO] ------------------------------------------------------------------------



Please help me.



Regards



Sagar
Frederic Daoud
author
Ranch Hand

Joined: May 22, 2008
Posts: 71
Hi Sagar,

Instead of fighting with Maven, you should try setting up the project. It's really not difficult at all, and I think there is value in knowing which files go in which directories. This page explains the setup:

http://struts.apache.org/2.x/docs/simple-setup.html


Frederic Daoud
Author, Stripes...and Java Web Development is Fun Again
Stripes book
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

I have never used Maven either, but I downloaded it, executed your command and it worked:


so the command and Maven appear to work fine.

These two messages make me think that you do not have an internet connection or have a proxy that's preventing Maven from downloading a dependency:


I concur with Frederic, when exploring new territory, it's best to concentrate on one thing to minimize frustration. If you can't get Maven to work, chuck it. Struts 2 works fine with Ant (that's what I use).
[ September 05, 2008: Message edited by: Joe Ess ]

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Hi Frederic & Joe,

Thank you very much for reply. I have internet connection. But I don't know why Maven did not work on my computer. Anyway I decided to give up Maven for time being and go with Ant.

Thanks once again for reply.


Regards

Sagar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Learning Struts 2