Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: S2 with eclipse/WTP

Don Brown

2006-12-15

Replies:

If you want to use the Web Tools Project, you might find this useful:
http://maven.apache.org/plugins/maven-eclipse-plugin/wtp.html

Basically, add a flag to tell the Maven 2 plugin to generate wtp files like so:

mvn -Dwtpversion=1.0 eclipse:eclipse

Don

On 12/15/06, Dariusz Wojtas <dwojtas@(protected):
> I also use eclipse with S2 with no problem, and 'mvn eclipse:eclipse'
> works as it should.
> I repeated it also today on fresh source tree.
>
> 1) define Maven repository (for referencing JAR files)
>  Window --> Preferences --> Java --> Build Path --> ClassPath Variables
> Define variable
>  M2_REPO
> with value pointing to your repository, in my case:
>  c:/Documents and Settings/Darek/.m2/repository
>
> 2)
> After this command, just open eclipse, menu
>   File --> Import --> Existin Projects into Workspace
>
> Root Directory: path to your Struts2 root.
> Button "Browse" and you get list of Struts projects (api, core, plugins)
>
>
> Works great.
> I only had 1 problem, when using maven to build JAR files of struts.
> By default eclipse is pointed to compile code into the same
> directories as maven, and maven was somehw confused with that -
> caching issues.
> You may change the eclipse build path by:
>  clicking on the project preferences, Java Build Path, Default Output Folder.
> Just specify some other directory.
> Now it seems to work.
>
> Side note
> From time to time my struts 2 compilation in maven only works if I
> fetch xwork sources into the same parent dir as struts2.
>
> Dariusz Wojtas
>
>
> On 12/15/06, Rick Schumeyer <rschumeyer@(protected):
> > I would like to learn S2 while using the eclipse/WTP IDE. I currently
> > use eclipse/WTP for a struts 1.3 project. But the way I constructed the
> > eclipse project was a bit of a pain.
> >
> > In reviewing the list archives, it looks like there is an easy way to
> > generate a blank template for an S2 project with eclipse/WTP using maven.
> >
> > The problem is, I don't really understand the process. It seems to have
> > something to do with the S2 source tree (which I have) a pom file, and
> > typing "mvn eclipse:eclipse". I tried that and I'm not really sure what
> > it did.
> >
> > I'm sure maven is a wonderful tool, but I'm hoping to avoid learning
> > much about it right now. Perhaps I'm lazy, but I'm still trying to
> > learn more about struts, jsp, servlets, hibernate, eclipse, ant, etc.
> > So is there an idiot-proof way for me to generate an eclipse/WTP/S2
> > project?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.