Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Eclipse does not include dependencies for maven-wtp
Eclipse does not include dependencies for maven-wtp [message #1711917] Tue, 20 October 2015 09:58 Go to next message
Mark Schmidt is currently offline Mark SchmidtFriend
Messages: 4
Registered: April 2015
Junior Member
Hello all,

I have been trying for quite some time now to get eclipse to work with a maven-based wtp2.0 project. The problem is *always* that some required dependencies are not deployed to the tomcat server.

Just to clarify: If I use "mvn package" to create a war, then everything works and all dependencies are included. The problem seems to be with eclipse in this case.

Essentially I have a "server" maven-wtp which has a "core" dependency which is a maven project I am also developing using eclipse. In addition the project depends on another external jar which I obtain from mvnrepository.com. This is noted as a
dependency in the project's pom.xml.

I took a look at ".settings/org.eclipse.wst.common.component" which supposedly stores dependencies in eclipse, it shows my core module:

        <dependent-module archiveName="core-1.0.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/core/core">
            <dependency-type>uses</dependency-type>
        </dependent-module>


However, the external dependency is not showing, it is not deployed and my server throws an exception:

java.lang.NoClassDefFoundError


Just to clarify: the maven dependencies *do* show up in the "Deployment Assembly" section and are supposed to be deployed to "WEB-INF/lib"

I am using Mars.1 Release (4.5.1), the problem occurs with and without using m2e-wtp (1.2.1.20150819-2220).

Does anyone know how to fix this issue?

[Updated on: Tue, 20 October 2015 15:42]

Report message to a moderator

Re: Eclipse does not include dependencies for maven-wtp [message #1713780 is a reply to message #1711917] Fri, 06 November 2015 15:52 Go to previous messageGo to next message
Niul Bird is currently offline Niul BirdFriend
Messages: 1
Registered: November 2015
Junior Member
Mark,
Hopefully you have already resolved this, but thought I'd respond as I was encountering the same issue when I came across your post.

I had same issue where if I build the WAR, it would link in the dependent JAR modules successfully. However, dependent JAR modules would not show up when running Tomcat in Eclipse under:

$WORKSPACE_HOME\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\${project.name}\WEB-INF\lib

It took a while for me to figure out my issue, but I used the sample project in the Maven Multi Module Project example as a baseline:

https //maven.apache.org/plugins/maven-eclipse-plugin/examples/multi-module-projects.html

What was missing in my case was the maven-eclipse-plugin definition at the Parent POM level (previous I had this at the WAR module level):

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-eclipse-plugin</artifactId>
					<configuration>
						<projectNameTemplate>
							[artifactId]-[version]
						</projectNameTemplate>
						<wtpmanifest>true</wtpmanifest>
						<wtpapplicationxml>true</wtpapplicationxml>
						<wtpversion>2.0</wtpversion>
						<manifest>
							${basedir}/src/main/resources/META-INF/MANIFEST.MF
						</manifest>
					</configuration>
				</plugin>


This ensured that I had org.eclipse.wst.common.component file for all modules which seemed to resolve the issue.

Hope that helps.
Re: Eclipse does not include dependencies for maven-wtp [message #1790597 is a reply to message #1711917] Wed, 13 June 2018 11:55 Go to previous message
Oliver Libutzki is currently offline Oliver LibutzkiFriend
Messages: 40
Registered: September 2011
Member
I encountered the same problem with Oxygen.3a. Does anyone have a solution?
Previous Topic:Gradle-based EAR project
Next Topic:JS Content Assist not working
Goto Forum:
  


Current Time: Thu Apr 25 03:33:52 GMT 2024

Powered by FUDForum. Page generated in 0.02993 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top