You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mick Knutson <mi...@gmail.com> on 2008/04/30 23:52:30 UTC
[m2] any tutorial on how to get Maven to compile and deploy in Tomcat/eclipse?
I am trying to switch from IntelliJ to eclipse. I used the eclipse:eclipse
plugin, but then used the sonatype plugin to import an existing maven
multi-module project I have.
1st i guess i don't understand how or what eclipse is going to use to deploy
to Tomcat. Does it try to deploy exploded, or the wacutal war archives?
2nd, I keep getting this error only when starting eclipse:
*Apr 30, 2008 2:50:51 PM org.apache.tomcat.util.digester.Digester
startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException:
org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener
*
I was hoping it would be easy to switch FROM intellij, but so far I am not
sure...
--
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---
Re: Maven and Eclipse: getting started
Posted by Russell Bateman <ru...@windofkeltia.com>.
Profuse thanks, Chris, for helping me get started here.
Russ
Chris_Graham@aami.com.au wrote:
>> And I've tried running "mvn eclipse" realizing that that is way too
>> naive as a starting point. I'm guessing that to create a Dynamic Web
>> Project under Maven control for use in Eclipse, I have to create a BLANK PROJECT on the command line in Maven, but there's something about the
>> Eclipse workbench plugin that will give me all the right directories and a fully WTP-armed POM. Then, I can copy (?) this blank somewhere and use it ever after (or just use Maven to create a new blank every time I need one)?
>>
>
> Look at archetypes.
>
> (Hint: http://docs.codehaus.org/display/M2ECLIPSE/New+and+Noteworthy)
>
> More importantly, have a look at:
>
> http://www.sonatype.com/book/
>
> Also, use this:
>
> http://m2eclipse.codehaus.org/
>
>
>> The questions I'm looking to answer are:
>>
>> - How do I invoke the Maven plugin inside Eclipse to "tell" Maven to
>> create me a "fully WTP-armed" POM?
>>
>
> mvn archetype:create ^
> -DarchetypeGroupId=<group id of the appropriate archetype> ^
> -DarchetypeArtifactId=<aart. id of the appropriate archetype> ^
> -DarchetypeVersion=1.0-SNAPSHOT ^
> -DgroupId=<Project Group Id> ^
> -DartifactId=<Project Name>
> cd <Project Name>
> mvn eclipse:eclipse
>
>
> That will get you started.
>
> We've set up a parent POM that has this section in it:
>
> <build>
> <pluginManagement>
> <plugins>
> <plugin>
> <artifactId>maven-eclipse-plugin</artifactId>
> <version>${maven-eclipse-plugin.version}</version>
> <configuration>
> <downloadSources>${ide.download.sources}</
> downloadSources>
> <downloadJavadocs>${ide.download.javadoc}</
> downloadJavadocs>
> <wtpversion>${eclipse.wtp.version}</wtpversion>
> </configuration>
> </plugin>
> </plugins>
> </pluginManagement>
> </build>
>
> <properties>
> <maven-eclipse-plugin.version>2.5.1</maven-eclipse-plugin.version>
>
> <ide.download.sources>true</ide.download.sources>
> <ide.download.javadoc>false</ide.download.javadoc>
>
> <eclipse.wtp.version>1.5</eclipse.wtp.version>
> </properties>
>
>
>
>> - What does it leave lying around that tells me this has succeeded?
>>
>> - What Maven command do I use on the Windoz/DOS command line to
>> create this mythical project with Eclipse .classpath/.metadata/etc.
>> stuff in it?
>>
>
> That is what the mvn eclipse:eclipse tasks does (by it's very definition)
>
>
>> - How do I import the new project into Eclipse so I can get developing?
>>
>
>
> Import it like any other (existing) eclipse project...
>
>
>> - Will the full-octane, WTP-armed POM and project hierarchy come
>> with /faces-config.xml/, /web.xml/, etc.
>>
>
> Depends on what archetypes you've used/parent pom's you've inherited from.
>
>
>> I have heard that this is possible and that Maven is going to do all
>> these cools things for me, but after hours of research reading link
>> after followed link, I've only stumbled on more or less how to install
>> and nothing about how to use. I'm not looking for anyone to do the work
>> for me, but a list of URLs or some pointers would be greatly helpful.
>>
>
> Not not that far ahead of you myself, and yes it is painfully difficult...
>
Re: Maven and Eclipse: getting started
Posted by Ch...@aami.com.au.
>
> And I've tried running "mvn eclipse" realizing that that is way too
> naive as a starting point. I'm guessing that to create a Dynamic Web
> Project under Maven control for use in Eclipse, I have to create a BLANK
> PROJECT on the command line in Maven, but there's something about the
> Eclipse workbench plugin that will give me all the right directories and
> a fully WTP-armed POM. Then, I can copy (?) this blank somewhere and use
> it ever after (or just use Maven to create a new blank every time I need
> one)?
Look at archetypes.
(Hint: http://docs.codehaus.org/display/M2ECLIPSE/New+and+Noteworthy)
More importantly, have a look at:
http://www.sonatype.com/book/
Also, use this:
http://m2eclipse.codehaus.org/
> The questions I'm looking to answer are:
>
> - How do I invoke the Maven plugin inside Eclipse to "tell" Maven to
> create me a "fully WTP-armed" POM?
mvn archetype:create ^
-DarchetypeGroupId=<group id of the appropriate archetype> ^
-DarchetypeArtifactId=<aart. id of the appropriate archetype> ^
-DarchetypeVersion=1.0-SNAPSHOT ^
-DgroupId=<Project Group Id> ^
-DartifactId=<Project Name>
cd <Project Name>
mvn eclipse:eclipse
That will get you started.
We've set up a parent POM that has this section in it:
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>${maven-eclipse-plugin.version}</version>
<configuration>
<downloadSources>${ide.download.sources}</
downloadSources>
<downloadJavadocs>${ide.download.javadoc}</
downloadJavadocs>
<wtpversion>${eclipse.wtp.version}</wtpversion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<properties>
<maven-eclipse-plugin.version>2.5.1</maven-eclipse-plugin.version>
<ide.download.sources>true</ide.download.sources>
<ide.download.javadoc>false</ide.download.javadoc>
<eclipse.wtp.version>1.5</eclipse.wtp.version>
</properties>
> - What does it leave lying around that tells me this has succeeded?
>
> - What Maven command do I use on the Windoz/DOS command line to
> create this mythical project with Eclipse .classpath/.metadata/etc.
> stuff in it?
That is what the mvn eclipse:eclipse tasks does (by it's very definition)
> - How do I import the new project into Eclipse so I can get
developing?
Import it like any other (existing) eclipse project...
> - Will the full-octane, WTP-armed POM and project hierarchy come
> with /faces-config.xml/, /web.xml/, etc.
Depends on what archetypes you've used/parent pom's you've inherited from.
> I have heard that this is possible and that Maven is going to do all
> these cools things for me, but after hours of research reading link
> after followed link, I've only stumbled on more or less how to install
> and nothing about how to use. I'm not looking for anyone to do the work
> for me, but a list of URLs or some pointers would be greatly helpful.
Not not that far ahead of you myself, and yes it is painfully difficult...
**********************************************************************
CAUTION - This message is intended for the addressee named above. It may contain privileged or confidential information.
If you are not the intended recipient of this message you must:
- Not use, copy, distribute or disclose it to anyone other than the addressee;
- Notify the sender via return email; and
- Delete the message (and any related attachments) from your computer immediately.
Internet emails are not necessarily secure. Australian Associated Motors Insurers Limited ABN 92 004 791 744 (AAMI), and its related entities, do not accept responsibility for changes made to this message after it was sent.
Unless otherwise stated, views expressed within this email are the author's own and do not represent those of AAMI.
**********************************************************************
Maven and Eclipse: getting started
Posted by Russell Bateman <ru...@windofkeltia.com>.
I'm looking for help getting going with Maven and Eclipse. I've read
lots, but have been unable to synthesis what I've read into a practical,
working procedure. I'm looking for some direction (URLs or other
suggestions).
Where am I?
I have downloaded Maven and run it successfully to create the sample
myapp Hello World project.
I have found and downloaded Maven plugins for Eclipse, though I haven't
figured out where to put them yet. For now, I've tucked them away in a
folder parallel to my Tomcat installation.
*C:\Program Files\Apache Software
Foundation\apache-maven-2.0.9\plugins> dir
Directory of C:\Program Files\Apache Software
Foundation\apache-maven-2.0.9\plugins
04/30/2008 07:38 PM <DIR> .
04/30/2008 07:38 PM <DIR> ..
04/30/2008 07:37 PM 409,126
maven-eclipse-plugin-2.5.1-javadoc.jar
04/30/2008 07:37 PM 181,400 maven-eclipse-plugin-2.5.1.jar
04/30/2008 07:38 PM 7,174 maven-eclipse-plugin-2.5.1.pom
3 File(s) 597,700 bytes
2 Dir(s) 95,256,113,152 bytes free*
I have used Eclipse's Sofware Update/Find and Install facility to fetch
down a plugin for Eclipse. These would apparently be the famous "Q"
plugins for use FROM Eclipse while the previous ones are those used FROM
Maven. Or so my reading encourages me to believe.
*C:\tutorial\eclipse\plugins>dir *maven*
Directory of C:\tutorial\eclipse\plugins
04/30/2008 09:04 PM 2,047,318
org.apache.maven.embedder_2.1.0.627670.jar
04/30/2008 09:04 PM 41,565
org.apache.maven.shared.dependency.tree_1.1.0.v200802050958.jar
04/30/2008 09:04 PM 426,398
org.devzuz.q.maven.core_0.6.0.200804131445.jar
04/30/2008 09:04 PM 63,497
org.devzuz.q.maven.dependency.analysis_0.6.0.200804131445.jar
04/30/2008 09:04 PM 17,652
org.devzuz.q.maven.dependencyviewer_0.6.0.200804131446.jar
04/30/2008 09:04 PM 48,308
org.devzuz.q.maven.jdt.core_0.6.0.200804131445.jar
04/30/2008 09:04 PM 54,760
org.devzuz.q.maven.jdt.ui_0.6.0.200804131445.jar
04/30/2008 09:04 PM 665,387
org.devzuz.q.maven.ui_0.6.0.200804131445.jar
04/30/2008 09:04 PM 148,246
org.devzuz.q.maven.wizard_0.6.0.200804131445.jar
04/30/2008 09:04 PM 7,834
org.devzuz.q.maven.wtp.core_0.6.0.200804131446.jar
10 File(s) 3,520,965 bytes
0 Dir(s) 95,256,096,768 bytes free*
And I've tried running "mvn eclipse" realizing that that is way too
naive as a starting point. I'm guessing that to create a Dynamic Web
Project under Maven control for use in Eclipse, I have to create a BLANK
PROJECT on the command line in Maven, but there's something about the
Eclipse workbench plugin that will give me all the right directories and
a fully WTP-armed POM. Then, I can copy (?) this blank somewhere and use
it ever after (or just use Maven to create a new blank every time I need
one)?
The questions I'm looking to answer are:
- How do I invoke the Maven plugin inside Eclipse to "tell" Maven to
create me a "fully WTP-armed" POM?
- What does it leave lying around that tells me this has succeeded?
- What Maven command do I use on the Windoz/DOS command line to
create this mythical project with Eclipse .classpath/.metadata/etc.
stuff in it?
- How do I import the new project into Eclipse so I can get developing?
- Will the full-octane, WTP-armed POM and project hierarchy come
with /faces-config.xml/, /web.xml/, etc.
I have heard that this is possible and that Maven is going to do all
these cools things for me, but after hours of research reading link
after followed link, I've only stumbled on more or less how to install
and nothing about how to use. I'm not looking for anyone to do the work
for me, but a list of URLs or some pointers would be greatly helpful.
Thanks in advance,
Russ Bateman
RE: [m2] any tutorial on how to get Maven to compile and deploy in Tomcat/eclipse?
Posted by "Allen, Daniel" <Da...@kbcfp.com>.
I'm not sure I can completely answer your question (relatively new user
myself), but I can tell you what we did here (we also develop in Eclipse
and deploy via Tomcat).
I have this plugin [1] to launch Tomcat via Eclipse and debug the
processes that are running in it. I haven't gotten Maven to smoothly
integrate with Eclipse insofar as building, so I still just run Maven
myself when it's time to rebuild. I believe there's a Maven-Eclipse
plugin that will take care of that, and also set the Classpath and
included JARs as appropriate, but I've seen a lot of complaints about it
on the board, and frankly I don't really mind manually doing those
things. I just leave a command line open and occasionally hit up-arrow +
Enter to re-execute the build when I want to test. We also wrote a
context.xml file to point Tomcat to the default Maven output directory.
This system works fine for our work, but may be a little more
inconvenient for you, since you have a multi-level thing going on.
Things I'm not sure about:
I would say that logically, core.jar should be a dependency *in Maven*
of the webapp. You should have your own local repository, build your
core using (I think) the "install" goal, and then build your webapp, and
Maven should take the core.jar it built in the previous step and put it
into the /WEB-INF/lib directory.
Perhaps you could clarify some things from your mail: what is the
command you're using to "publish?" When you say that "the core project
(not just the jar)" is a dependency of the webapp, do you mean a Maven
dependency, or an Eclipse project dependency?
Hope there's something helpful for you in there.
~Dan Allen
[1] http://www.eclipsetotale.com/tomcatPlugin.html
-----Original Message-----
From: Mick Knutson [mailto:mickknutson@gmail.com]
Sent: Wednesday, April 30, 2008 6:08 PM
To: maven
Subject: Re: [m2] any tutorial on how to get Maven to compile and deploy
in Tomcat/eclipse?
I have 2 artifacts in this project. Core and Webapp.
When I have the core project (not just the jar) as a dependancy of my
webapp, I get this error when i publish:
*Error creating zip file core.jar: duplicate entry:
META-INF/persistence.xml
duplicate entry: META-INF/persistence.xml*
persistence.xml is in src/main/resources/META-INF, as well as
target/classes/META-INF.
But when I use the core-2.2.jar as the dependancy of my webapp, i can
publish fine, but then get this error:
*Apr 30, 2008 3:06:51 PM org.apache.tomcat.util.digester.Digester
startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException:
org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.
java:205)
at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
at
org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1358
)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElemen
t(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emp
tyElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$F
ragmentContentDispatcher.dispatch(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.s
canDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
own
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unkn
own
Source)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unkno
wn
Source)
at
org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:516)
at org.apache.catalina.startup.Catalina.load(Catalina.java:550)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
*
On Wed, Apr 30, 2008 at 2:52 PM, Mick Knutson <mi...@gmail.com>
wrote:
> I am trying to switch from IntelliJ to eclipse. I used the
eclipse:eclipse
> plugin, but then used the sonatype plugin to import an existing maven
> multi-module project I have.
>
> 1st i guess i don't understand how or what eclipse is going to use to
> deploy to Tomcat. Does it try to deploy exploded, or the wacutal war
> archives?
>
> 2nd, I keep getting this error only when starting eclipse:
>
> *Apr 30, 2008 2:50:51 PM org.apache.tomcat.util.digester.Digester
> startElement
> SEVERE: Begin event threw exception
> java.lang.ClassNotFoundException:
> org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener
> *
>
> I was hoping it would be easy to switch FROM intellij, but so far I am
not
> sure...
>
> --
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.linkedin.com/in/mickknutson
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/BLiNCMagazine
> http://tahoe.baselogic.com
> ---
--
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---
--
This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as "KBC FP").
This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] any tutorial on how to get Maven to compile and deploy in Tomcat/eclipse?
Posted by Mick Knutson <mi...@gmail.com>.
I have 2 artifacts in this project. Core and Webapp.
When I have the core project (not just the jar) as a dependancy of my
webapp, I get this error when i publish:
*Error creating zip file core.jar: duplicate entry: META-INF/persistence.xml
duplicate entry: META-INF/persistence.xml*
persistence.xml is in src/main/resources/META-INF, as well as
target/classes/META-INF.
But when I use the core-2.2.jar as the dependancy of my webapp, i can
publish fine, but then get this error:
*Apr 30, 2008 3:06:51 PM org.apache.tomcat.util.digester.Digester
startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException:
org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:205)
at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
at
org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1358)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:516)
at org.apache.catalina.startup.Catalina.load(Catalina.java:550)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
*
On Wed, Apr 30, 2008 at 2:52 PM, Mick Knutson <mi...@gmail.com> wrote:
> I am trying to switch from IntelliJ to eclipse. I used the eclipse:eclipse
> plugin, but then used the sonatype plugin to import an existing maven
> multi-module project I have.
>
> 1st i guess i don't understand how or what eclipse is going to use to
> deploy to Tomcat. Does it try to deploy exploded, or the wacutal war
> archives?
>
> 2nd, I keep getting this error only when starting eclipse:
>
> *Apr 30, 2008 2:50:51 PM org.apache.tomcat.util.digester.Digester
> startElement
> SEVERE: Begin event threw exception
> java.lang.ClassNotFoundException:
> org.jboss.embedded.tomcat.EmbeddedJBossBootstrapListener
> *
>
> I was hoping it would be easy to switch FROM intellij, but so far I am not
> sure...
>
> --
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.linkedin.com/in/mickknutson
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/BLiNCMagazine
> http://tahoe.baselogic.com
> ---
--
Thanks,
Mick Knutson
http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---