You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alexandre Poitras <al...@gmail.com> on 2005/11/03 20:24:16 UTC

[M2] How to work with Eclipse Wtp and maven2

Hi all,

I found off some mails on this subject but I can't seems to get the big
picture to how work at the same time with eclipse wtp and maven 2. The
documentation seems very sparse and seems to use different tricks. Can
someone who got it working give me some quick hints of the differences
between working with Maven 2 with the regular version of eclipse and with
eclipse Wtp.

Thank for any help. Really appreciated!

--
Alexandre Poitras
Québec, Canada

Re: List of Maven Archetypes?

Posted by Wendy Smoak <ws...@gmail.com>.
On 7/1/06, siegfried <si...@heintze.com> wrote:

> What projects? Is there a list of starter projects I can start from?

I've added the ones I know about:
   http://docs.codehaus.org/display/MAVENUSER/Archetype+Plugin

-- 
Wendy

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


Re: List of Maven Archetypes?

Posted by Wendy Smoak <ws...@gmail.com>.
On 7/1/06, siegfried <si...@heintze.com> wrote:
>
> >IMO the projects themselves should provide the archetypes.
>
> What projects? Is there a list of starter projects I can start from?

Somewhere on my very long list of things to do is to start a wiki page
listing the known available archetypes.  It can go under this space:
http://docs.codehaus.org/display/MAVENUSER/Home

Right now we have a half-dozen or so between Struts, Shale, and
MyFaces.  I'm not completely happy with any of mine, I'm still
struggling with how best to create multi-module archetypes.

-- 
Wendy

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


Re: List of Maven Archetypes?

Posted by Wendy Smoak <ws...@gmail.com>.
On 6/25/06, Mike Lundin <da...@orst.edu> wrote:
> Is there a way to have archetypes act cumulatively?  It seems to me that it
> would make sense that you would be able to run an archetype command multiple
> times in a directory and still end up with only one pom and set of
> directories.  That way, what Wendy suggests below would work.  If you have
> Struts elements, you run the Struts archetype.  Then, if you have Hibernate
> or Spring, you can run that afterwards and still keep them in the same
> project.
>
> Am I misunderstanding the whole idea of an archetype when I think like this?

It seems to be one archetype == one module.  If you're going to run it
multiple times, you create a parent pom, then do mvn archetype:create
a few times, and it *does* handle setting up the parent/child module
relationships.

My fear is that people will just do the webapp module, and never set
up the integration tests, so I tend to want to keep it all together.

AFAIK, the archetype plugin will not "overlay" an existing project,
for example to add more dependencies to a pom.  It just complains that
the directory already exists.

-- 
Wendy

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


Re: List of Maven Archetypes?

Posted by Mike Lundin <da...@orst.edu>.
Is there a way to have archetypes act cumulatively?  It seems to me that it
would make sense that you would be able to run an archetype command multiple
times in a directory and still end up with only one pom and set of
directories.  That way, what Wendy suggests below would work.  If you have
Struts elements, you run the Struts archetype.  Then, if you have Hibernate
or Spring, you can run that afterwards and still keep them in the same
project.

Am I misunderstanding the whole idea of an archetype when I think like this?

Thanks,
Mike

On 6/25/06, Wendy Smoak <ws...@gmail.com> wrote:
>
> On 6/24/06, siegfried <si...@heintze.com> wrote:
>
> > I was specifically hoping to find an EJB, SWT, Swing and a boatload of
> web
> > archetypes like tapestry, spring and other MVCs.
>
> IMO the projects themselves should provide the archetypes.  This
> proves to be more difficult than it sounds... for Struts I didn't go
> beyond turning the "Struts Blank" webapp into an archetype, because
> after that, how should I know whether you want Hibernate, iBatis,
> Spring, etc?  At that point, it's not an archetype, it's AppFuse.
>
> The next challenge is building a multi-module archetype.  The current
> best practices say to put your integration tests in a separate module,
> but Archetype seems to only want to do one module at a time.  Either
> you have to type 'mvn archetype:create' several times, or you stuff it
> all under archetype-resources and lose the ability to specify the
> package name.
>
> I know Apache MyFaces has a couple of archetypes available, one for a
> webapp, and the other for a JSF component library.  I think that's how
> it will continue, once projects convert to Maven 2 (it's inevitable,
> right?) they will provide their own archetypes.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Mike Lundin

RE: List of Maven Archetypes?

Posted by siegfried <si...@heintze.com>.
>IMO the projects themselves should provide the archetypes.  

What projects? Is there a list of starter projects I can start from?

>This
>proves to be more difficult than it sounds... for Struts I didn't go
>beyond turning the "Struts Blank" webapp into an archetype, because
>after that, how should I know whether you want Hibernate, iBatis,
>Spring, etc?  

Hmmm... well, maven 1.0.2 justed asked a lot of questions. I could go for
that.

>At that point, it's not an archetype, it's AppFuse.

That is not so bad. The problem with AppFuse is that there is no dialog
asking you what you want and don't want. For something as complex as
AppFuse, one should really have a GUI.


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


Re: List of Maven Archetypes?

Posted by Wendy Smoak <ws...@gmail.com>.
On 6/24/06, siegfried <si...@heintze.com> wrote:

> I was specifically hoping to find an EJB, SWT, Swing and a boatload of web
> archetypes like tapestry, spring and other MVCs.

IMO the projects themselves should provide the archetypes.  This
proves to be more difficult than it sounds... for Struts I didn't go
beyond turning the "Struts Blank" webapp into an archetype, because
after that, how should I know whether you want Hibernate, iBatis,
Spring, etc?  At that point, it's not an archetype, it's AppFuse.

The next challenge is building a multi-module archetype.  The current
best practices say to put your integration tests in a separate module,
but Archetype seems to only want to do one module at a time.  Either
you have to type 'mvn archetype:create' several times, or you stuff it
all under archetype-resources and lose the ability to specify the
package name.

I know Apache MyFaces has a couple of archetypes available, one for a
webapp, and the other for a JSF component library.  I think that's how
it will continue, once projects convert to Maven 2 (it's inevitable,
right?) they will provide their own archetypes.

-- 
Wendy

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


Re: List of Maven Archetypes?

Posted by Wendy Smoak <ws...@gmail.com>.
On 7/1/06, siegfried <si...@heintze.com> wrote:

> Now what? I tried "mvn war" and that did not work! How can I automate the
> process of creating a war file and copy it to the deployment directory of
> tomcat or jboss or jetty?

It would usually be 'mvn package' or 'mvn install'.

To deploy it, I would use Cargo, which has a Maven 2 plugin.
   http://cargo.codehaus.org

-- 
Wendy

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


Re: Wanted: Jelly script for deploying maven 1.0 web app to tomcat

Posted by Arnaud HERITIER <ah...@gmail.com>.
You can also use the Cargo m1 plugin.
http://cargo.codehaus.org

Arnaud

On 7/1/06, Tomasz Pik <to...@gmail.com> wrote:
>
> On 7/1/06, siegfried <si...@heintze.com> wrote:
>
> > Now build.xml scripts usually have a deploy target for them. Is there a
> > jelly or some other script for maven 1.0 to do that last step of copying
> the
> > war file to the web server?
>
> There's a dedictaed plugin that may help you with deploying to tomcat:
> http://www.codeczar.com/products/maven-tomcat-plugin/
>
> Regards,
> Tomek
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Wanted: Jelly script for deploying maven 1.0 web app to tomcat

Posted by Tomasz Pik <to...@gmail.com>.
On 7/1/06, siegfried <si...@heintze.com> wrote:

> Now build.xml scripts usually have a deploy target for them. Is there a
> jelly or some other script for maven 1.0 to do that last step of copying the
> war file to the web server?

There's a dedictaed plugin that may help you with deploying to tomcat:
http://www.codeczar.com/products/maven-tomcat-plugin/

Regards,
Tomek

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


Re: List of Maven Archetypes?

Posted by Wendy Smoak <ws...@gmail.com>.
On 7/2/06, siegfried <si...@heintze.com> wrote:
> Could someone kindly point me to the URL where these commands are
> documented?

They're not so much commands as they are build lifecycle phases.

'mvn' is the command, and then you tell it which phase to execute
through.  See if this helps:
 * http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

Plugins are bound to various phases, so as Maven passes through the
build phases, it fires  executions of the plugins.

Something like 'mvn war:war' is a direct execution of a plugin goal.
For that you would consult the war plugin docs (which point out that
'mvn package' is the preferred way to to it.)
 * http://maven.apache.org/plugins/maven-war-plugin/war.html

-- 
Wendy

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


RE: List of Maven Archetypes?

Posted by siegfried <si...@heintze.com>.
Could someone kindly point me to the URL where these commands are
documented?
Thanks,
Siegfried

-----Original Message-----
From: Trent Rosenbaum [] 
Sent: Saturday, July 01, 2006 3:33 PM
To: Maven Users List
Subject: Re: List of Maven Archetypes?

Hi there,

To use the WAR plugin for Maven 2 you must execute the following war goal:

mvn war:war

This will then create a war projet within the target directory.

As for using tomcat and jetty you can find out more on the appropriate
plugin from the following site

http://mojo.codehaus.org/

I had trouble downloading the plugings out of the sandbox so I checked out
the source code from the mojo SVN and executed a mvn intall on the project.

Hope this helps

Trent


On 01/07/06, siegfried <si...@heintze.com> wrote:
>
> I tried your (pete's) example:
>
>        mvn archetype:create -DartifactId=test -DgroupId=org.test
> -DarchetypeArtifactId=maven-archetype-webapp
>
> -DarchetypeGroupId=org.apache.maven.archetypes
> -DarchetypeVersion=1.0-alpha-4
>
> Now what? I tried "mvn war" and that did not work! How can I automate the
> process of creating a war file and copy it to the deployment directory of
> tomcat or jboss or jetty?
>
> Thanks,
>
> Siegfried
>
>
>
> ---------------------------------------------------------------------
> 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: List of Maven Archetypes?

Posted by Trent Rosenbaum <tr...@gmail.com>.
Hi there,

To use the WAR plugin for Maven 2 you must execute the following war goal:

mvn war:war

This will then create a war projet within the target directory.

As for using tomcat and jetty you can find out more on the appropriate
plugin from the following site

http://mojo.codehaus.org/

I had trouble downloading the plugings out of the sandbox so I checked out
the source code from the mojo SVN and executed a mvn intall on the project.

Hope this helps

Trent


On 01/07/06, siegfried <si...@heintze.com> wrote:
>
> I tried your (pete's) example:
>
>        mvn archetype:create -DartifactId=test -DgroupId=org.test
> -DarchetypeArtifactId=maven-archetype-webapp
>
> -DarchetypeGroupId=org.apache.maven.archetypes
> -DarchetypeVersion=1.0-alpha-4
>
> Now what? I tried "mvn war" and that did not work! How can I automate the
> process of creating a war file and copy it to the deployment directory of
> tomcat or jboss or jetty?
>
> Thanks,
>
> Siegfried
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: List of Maven Archetypes?

Posted by siegfried <si...@heintze.com>.
I tried your (pete's) example:

       mvn archetype:create -DartifactId=test -DgroupId=org.test
-DarchetypeArtifactId=maven-archetype-webapp

-DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeVersion=1.0-alpha-4

Now what? I tried "mvn war" and that did not work! How can I automate the
process of creating a war file and copy it to the deployment directory of
tomcat or jboss or jetty?

Thanks,

Siegfried



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


Wanted: Jelly script for deploying maven 1.0 web app to tomcat

Posted by siegfried <si...@heintze.com>.
> try checking http://www.ibiblio.org/maven2/org/apache/maven/archetypes
>for the latest version of the archetypes
> and if you feel  the  urge to write a guide on how to use them, the
>Maven community will greatly appreciate it. =)

I'll try out the mvn 2 webapp archetype soon but your comments are not
encouraging (but nevertheless appreciated).

How about maven 1 genapp? Is there any documentation on that? 

I guessed tried "maven war" and 

bash-3.00$ cp target/id_hello.war /c/Program\ Files/Apache\
Software\Foundation/Tomcat\ 5.5/webapps/

Lo and behold it worked! 

Are there any other maven targets I relevant to web apps that I would like
to know about?

Now build.xml scripts usually have a deploy target for them. Is there a
jelly or some other script for maven 1.0 to do that last step of copying the
war file to the web server?

Thanks,
Siegfried


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


Re: List of Maven Archetypes?

Posted by Pete Marvin King <la...@gmail.com>.
 Currently there's :
      - maven-archetype-j2ee-simple
      - maven-archetype-portlet
      - maven-archetype-simple
      - maven-archetype-site-simple
      - maven-archetype-webapp
      - maven-archetype-marmalade-mojo
      - maven-archetype-quickstart
           

  Sorry, I'm not sure if there's a guide for each. running mvn site:site
on archetypes only generates the basic reports..no guides.
 
  command for generating projects using archetype :

  mvn archetype:create -DgroupId=<group> -DartifactId=<artifact name> 
-DarchetypeGroupId=org.apache.maven.archetype
                                      -DarchetypeArtifactId=<archetype
name> -DarchetypeVersion=<version>

  ex.
       mvn archetype:create -DartifactId=test -DgroupId=org.test
-DarchetypeArtifactId=maven-archetype-webapp  
                                          
-DarchetypeGroupId=org.apache.maven.archetypes
-DarchetypeVersion=1.0-alpha-4


 try checking http://www.ibiblio.org/maven2/org/apache/maven/archetypes
for the latest version of the archetypes
 and if you feel  the  urge to write a guide on how to use them, the
Maven community will greatly appreciate it. =)


cheers,
pete marvin


siegfried wrote:
> I'm doing a google search for maven archetypes and was expecting to find a
> long list of archetypes. Instead I found definitions of the term and a
> section on creating archetypes.
>
> Back in fall of 2005 (or was it winter 2006?) m2 did not have many
> archetypes yet. I was guessing by now someone would of ported all the m1
> archetypes (or whatever they were called) to m2. Has this happened?
>
> I found one at http://maven.apache.org/guides/mini/guide-webapp.html and
> I'll try this out soon.
>
> I was specifically hoping to find an EJB, SWT, Swing and a boatload of web
> archetypes like tapestry, spring and other MVCs.
>
> Thanks,
> Siegfried
>
>
> ---------------------------------------------------------------------
> 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


List of Maven Archetypes?

Posted by siegfried <si...@heintze.com>.
I'm doing a google search for maven archetypes and was expecting to find a
long list of archetypes. Instead I found definitions of the term and a
section on creating archetypes.

Back in fall of 2005 (or was it winter 2006?) m2 did not have many
archetypes yet. I was guessing by now someone would of ported all the m1
archetypes (or whatever they were called) to m2. Has this happened?

I found one at http://maven.apache.org/guides/mini/guide-webapp.html and
I'll try this out soon.

I was specifically hoping to find an EJB, SWT, Swing and a boatload of web
archetypes like tapestry, spring and other MVCs.

Thanks,
Siegfried


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


Re: Error getting POM for 'org.codehaus.plexus:plexus-container-default'

Posted by Trygve Laugstøl <tr...@apache.org>.
siegfried wrote:
> 
> 
> I just downloaded maven 2.0.4 and put the bin directory in my path.
> 
> As per the instructions at
> http://maven.apache.org/guides/mini/guide-webapp.html I issued the following
> command:
> 
> mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-webapp
> -DarchetypeArtifactId=maven-archetype-webapp
> 
> This seemed to work. I then type "cd my-webapp".
> 
> Then I do this (see below) and I get an error.
> 
> What am I doing wrong? Do I just need to try it again later because a
> repository is offline?

Try again, sometimes the repository has issues redirecting you. The file 
is there (it's not a file not found error), but something else has gone 
wrong.

> Reason: Error getting POM for 'org.codehaus.plexus:plexus-container-default'
> fro
> m the repository: Error transferring file
>   org.codehaus.plexus:plexus-container-default:1.0-alpha-9:pom

--
Trygve

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


Error getting POM for 'org.codehaus.plexus:plexus-container-default'

Posted by siegfried <si...@heintze.com>.


I just downloaded maven 2.0.4 and put the bin directory in my path.

As per the instructions at
http://maven.apache.org/guides/mini/guide-webapp.html I issued the following
command:

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

This seemed to work. I then type "cd my-webapp".

Then I do this (see below) and I get an error.

What am I doing wrong? Do I just need to try it again later because a
repository is offline?

I did a quick google search for the error and apparently someone else is
getting similar errors. However, I could not find a resolution.

Thanks,
Siegfried


bash-3.00$ mvn package
[INFO] Scanning for projects...
[INFO]
-------------------------------------------------------------------------
---
[INFO] Building Maven Webapp Archetype
[INFO]    task-segment: [package]
[INFO]
-------------------------------------------------------------------------
---
[INFO] artifact org.apache.maven.plugins:maven-war-plugin: checking for
updates
from central
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-pl
ugin/2.0/maven-war-plugin-2.0.pom
1K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugin
s/1/maven-plugins-1.pom
3K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-parent/1/maven
-parent-1.pom
6K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/apache/1/apache-1.pom
3K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-war-pl
ugin/2.0/maven-war-plugin-2.0.jar
21K downloaded
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-archiver/2.0.1
/maven-archiver-2.0.1.pom
912b downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven/2.0.1/maven-2.
0.1.pom
11K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-project/2.0.1/
maven-project-2.0.1.pom
1K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-model/2.0.1/ma
ven-model-2.0.1.pom
2K downloaded
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.0.
5/plexus-utils-1.0.5.pom
918b downloaded
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus/1.0.4/plex
us-1.0.4.pom
5K downloaded
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-profile/2.0.1/
maven-profile-2.0.1.pom
1K downloaded
Downloading:
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-container-
default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.pom
1K downloaded
[INFO]
-------------------------------------------------------------------------
---
[ERROR] BUILD ERROR
[INFO]
-------------------------------------------------------------------------
---
[INFO] Error building POM (may not be this project's POM).


Project ID: org.codehaus.plexus:plexus-container-default

Reason: Error getting POM for 'org.codehaus.plexus:plexus-container-default'
fro
m the repository: Error transferring file
  org.codehaus.plexus:plexus-container-default:1.0-alpha-9:pom

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  apache.snapshots (http://svn.apache.org/maven-snapshot-repository),
  snapshots (http://snapshots.maven.codehaus.org/maven2)



[INFO]
-------------------------------------------------------------------------
---
[INFO] For more information, run Maven with the -e switch
[INFO]
-------------------------------------------------------------------------
---
[INFO] Total time: 7 seconds
[INFO] Finished at: Sat Jun 24 14:01:05 MDT 2006
[INFO] Final Memory: 3M/6M
[INFO]
-------------------------------------------------------------------------
---
bash-3.00$


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


Re: [M2] How to work with Eclipse Wtp and maven2

Posted by Alexandre Poitras <al...@gmail.com>.
I finally found the solution. For those you are wondering the same thing,
there's the solution
http://jira.codehaus.org/browse/MNG-1430?page=all.<http://jira.codehaus.org/browse/MNG-1430?page=all>Thank
to the submitter of the patch. Helps a lot.


On 11/3/05, Alexandre Poitras <al...@gmail.com> wrote:
>
> Hi all,
>
> I found off some mails on this subject but I can't seems to get the big
> picture to how work at the same time with eclipse wtp and maven 2. The
> documentation seems very sparse and seems to use different tricks. Can
> someone who got it working give me some quick hints of the differences
> between working with Maven 2 with the regular version of eclipse and with
> eclipse Wtp.
>
> Thank for any help. Really appreciated!
>
> --
> Alexandre Poitras
> Québec, Canada




--
Alexandre Poitras
Québec, Canada