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:[EMAIL PROTECTED] 
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 <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to