You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paul Rivera <pa...@yahoo.com> on 2012/01/12 23:52:21 UTC

maven and wtp dependencies not in WEB-INF/lib

Hi Guys,

In a nutshell, I'm using maven on a web project which has a dependency on a java project.  Both projects are in my eclipse workspace.  By running "mvn eclipse:eclipse -Dwtpversion=2.0", maven resolves that the java project dependency is in my workspace.  But when I run my web project on a server from within eclipse (i.e. the servers tab), it does not load the jar of my java project.  I've looked into the folder where my webapp gets deployed (blahblahblah\workspace-helios\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\mywebapp\WEB-INF\lib) and confirmed that the jar is not there.

I think that the problem is when maven tries to resolve that the java project is in my workspace and loads it from there instead of the M2_REPO.  Changing the following fixes this:
FROM:
<dependent-module archiveName="opinionwatch-core.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/opinionwatch-core/opinionwatch-core">
      <dependency-type>uses</dependency-type>
    </dependent-module>

TO:

<dependent-module archiveName="opinionwatch-core-3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/nicta/opinionwatch-core/3.0-SNAPSHOT/opinionwatch-core-3.0-SNAPSHOT.jar">
      <dependency-type>uses</dependency-type>
    </dependent-module>

(NOTE: opinionwatch-core is the name of the java project dependency)


This seems to be a clear bug.  I've seen some people post some overcomplicated workarounds.  Is there any plan to fix this?


Best Regards,
Paul Rivera

Re: maven and wtp dependencies not in WEB-INF/lib

Posted by Ron Wheeler <rw...@artifact-software.com>.
Trying to use Maven without a repo is a horrible way to work.
Install a proper Maven repo.

Your problem looks like an Eclipse issue and you can probably get more 
interest in an Eclipse forum.

Ron

On 12/01/2012 5:52 PM, Paul Rivera wrote:
> Hi Guys,
>
> In a nutshell, I'm using maven on a web project which has a dependency on a java project.  Both projects are in my eclipse workspace.  By running "mvn eclipse:eclipse -Dwtpversion=2.0", maven resolves that the java project dependency is in my workspace.  But when I run my web project on a server from within eclipse (i.e. the servers tab), it does not load the jar of my java project.  I've looked into the folder where my webapp gets deployed (blahblahblah\workspace-helios\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\mywebapp\WEB-INF\lib) and confirmed that the jar is not there.
>
> I think that the problem is when maven tries to resolve that the java project is in my workspace and loads it from there instead of the M2_REPO.  Changing the following fixes this:
> FROM:
> <dependent-module archiveName="opinionwatch-core.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/opinionwatch-core/opinionwatch-core">
>        <dependency-type>uses</dependency-type>
>      </dependent-module>
>
> TO:
>
> <dependent-module archiveName="opinionwatch-core-3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/nicta/opinionwatch-core/3.0-SNAPSHOT/opinionwatch-core-3.0-SNAPSHOT.jar">
>        <dependency-type>uses</dependency-type>
>      </dependent-module>
>
> (NOTE: opinionwatch-core is the name of the java project dependency)
>
>
> This seems to be a clear bug.  I've seen some people post some overcomplicated workarounds.  Is there any plan to fix this?
>
>
> Best Regards,
> Paul Rivera
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102



Re: maven and wtp dependencies not in WEB-INF/lib

Posted by Gabriel Belingueres <be...@gmail.com>.
Hi!

I see you are running with -Dwtpversion=2.0. According to the 2.8
version docs [1], it is NOT supported. In my experience, I always use
1.5 and any other higher version doesn't work.

3 things you want to make sure you have properly configured:

* M2_REPO is defined inside eclipse
* that you correctly declared the dependency inside your project's pom.xml.
* that the dependency is installed in your local repo.

Also, if you want to make sure your project doesn't open any other
dependent eclipse project, add this to the configuration:
<useProjectReferences>false</useProjectReferences>

Gabriel

[1] http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html#wtpversion
.

2012/1/12 Paul Rivera <pa...@yahoo.com>:
> Hi Guys,
>
> In a nutshell, I'm using maven on a web project which has a dependency on a java project.  Both projects are in my eclipse workspace.  By running "mvn eclipse:eclipse -Dwtpversion=2.0", maven resolves that the java project dependency is in my workspace.  But when I run my web project on a server from within eclipse (i.e. the servers tab), it does not load the jar of my java project.  I've looked into the folder where my webapp gets deployed (blahblahblah\workspace-helios\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\mywebapp\WEB-INF\lib) and confirmed that the jar is not there.
>
> I think that the problem is when maven tries to resolve that the java project is in my workspace and loads it from there instead of the M2_REPO.  Changing the following fixes this:
> FROM:
> <dependent-module archiveName="opinionwatch-core.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/opinionwatch-core/opinionwatch-core">
>       <dependency-type>uses</dependency-type>
>     </dependent-module>
>
> TO:
>
> <dependent-module archiveName="opinionwatch-core-3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/nicta/opinionwatch-core/3.0-SNAPSHOT/opinionwatch-core-3.0-SNAPSHOT.jar">
>       <dependency-type>uses</dependency-type>
>     </dependent-module>
>
> (NOTE: opinionwatch-core is the name of the java project dependency)
>
>
> This seems to be a clear bug.  I've seen some people post some overcomplicated workarounds.  Is there any plan to fix this?
>
>
> Best Regards,
> Paul Rivera

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


Re: maven and wtp dependencies not in WEB-INF/lib

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Jan 13, 2012 at 9:22 AM, Paul Rivera <pa...@yahoo.com> wrote:
> Hi Guys,
>
> In a nutshell, I'm using maven on a web project which has a dependency on a java project.  Both projects are in my eclipse workspace.  By running "mvn eclipse:eclipse -Dwtpversion=2.0", maven resolves that the java project dependency is in my workspace.  But when I run my web project on a server from within eclipse (i.e. the servers tab), it does not load the jar of my java project.  I've looked into the folder where my webapp gets deployed (blahblahblah\workspace-helios\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\mywebapp\WEB-INF\lib) and confirmed that the jar is not there.
>
> I think that the problem is when maven tries to resolve that the java project is in my workspace and loads it from there instead of the M2_REPO.  Changing the following fixes this:
> FROM:
> <dependent-module archiveName="opinionwatch-core.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/opinionwatch-core/opinionwatch-core">
>       <dependency-type>uses</dependency-type>
>     </dependent-module>
>
> TO:
>
> <dependent-module archiveName="opinionwatch-core-3.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/nicta/opinionwatch-core/3.0-SNAPSHOT/opinionwatch-core-3.0-SNAPSHOT.jar">
>       <dependency-type>uses</dependency-type>
>     </dependent-module>
>
> (NOTE: opinionwatch-core is the name of the java project dependency)
>
>
> This seems to be a clear bug.  I've seen some people post some overcomplicated workarounds.  Is there any plan to fix this?

The first step would be to check JIRA
https://jira.codehaus.org/browse/MECLIPSE to see if it has already
been reported.

Remember, maven-eclipse-plugin is trying to configure your Eclipse
environment for you but not all cases may be catered for.
While running your web project from a server within eclipse is common
enough it might be that not well supported.
I don't know the answer to that, since I don't do web based development.

To help enhance the plugin's support, someone needs to work out what
the "Eclipse Way" is via manually fiddling with things.
And then someone needs to update the plugin to automate this.
Feel free to help out, that's the quickest way to ensure things get fixed.

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