Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » JDT Debug dependencies in MAVEN(Eclipse doesn't recognize the added JDT DEBUG MAVEN dependency)
JDT Debug dependencies in MAVEN [message #1705397] Fri, 14 August 2015 10:47 Go to next message
Eclipse UserFriend
Hi all,

I am trying to use the jdt debug in a project.
I have created a bundle project and added the dependencies with maven:

<project ....>
	<modelVersion>4.0.0</modelVersion>
	<!-- | Parent specification | -->
	<parent>
		.......
	</parent>
	
	<groupId>mygroupID</groupId>
	<artifactId>myartifactID</artifactId>
	<name>Implementation</name>
	<packaging>bundle</packaging>

	<dependencies>
	
		<dependency>
			<groupId>org.eclipse.debug</groupId>
			<artifactId>core</artifactId>
			<version>[3.3.0,4.0.0)</version>
		</dependency>
			
		<dependency>
			<groupId>org.eclipse.jdt</groupId>
			<artifactId>core</artifactId>
			<version>[3.3.0,4.0.0)</version>
		</dependency>
		
		<dependency>
			<groupId>org.eclipse.core</groupId>
			<artifactId>runtime</artifactId>
			<version>[3.3.0,4.0.0)</version>
		</dependency>
		
		<dependency>
			<groupId>org.eclipse.jdt</groupId>
			<artifactId>debug</artifactId>
			<version>3.2.1-r321_v20060731</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jdt.launching</groupId>
			<artifactId>macosx</artifactId>
			<version>3.1.100-v20061211</version>
		</dependency>
	</dependencies>
	
	<build>
		<finalName>${project.artifactId}</finalName>
		<sourceDirectory>/src/main/java</sourceDirectory>
		<testSourceDirectory>/src/test/java</testSourceDirectory>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
						<Bundle-Activator>myActivator</Bundle-Activator>
						<Import-Package>*</Import-Package>
						<Export-Package>myExportedPackage.*</Export-Package>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>


everything looks fine except for the
import org.eclipse.jdt.debug.core.*

that is not recognized by Eclipse and that gives me a compilation error telling me that the type cannot be resolved.
I checked the library and I saw that it contains a jar with other jars, so I tried a small workaround extracting one of the jar outside (jdimodel.jar) and asking maven to point directly to the jar in the file system like this:

<dependency>
	<groupId>org.eclipse.jdt</groupId>
	<artifactId>debug</artifactId>
	<version>3.2.1-r321_v20060731</version>
        <scope>system</scope>		       <systemPath>${project.basedir}/lib/jdimodel.jar</systemPath>
</dependency>


but nothing happened.
Someone have any idea?
Many thanks.
Re: JDT Debug dependencies in MAVEN [message #1705613 is a reply to message #1705397] Mon, 17 August 2015 15:35 Go to previous messageGo to next message
Eclipse UserFriend
Eclipse builds use tycho (manifest-first), which seems to better fit the way how eclipse plugins are packaged.
I have no idea how a pom-first approach using org.apache.felix:maven-bundle-plugin can be told to handle nested jars, sorry.
I assume the failure of your workaround might be caused by the fact that jdimodel.jar is not an OSGi bundle.
OTOH, the manifest of the enclosing org.eclipse.jdt.debug bundle declares:
Bundle-ClassPath: jdi.jar,jdimodel.jar,tools.jar

Ideally, some part of your tool chain should translate that into an addition to the project's classpath.

Does m2e have a connector for maven-bundle-plugin? I believe that would be the part that would help m2e figure out how to present such maven dependencies to JDT.

Stephan
Re: JDT Debug dependencies in MAVEN [message #1705669 is a reply to message #1705613] Tue, 18 August 2015 05:15 Go to previous message
Eclipse UserFriend
Hi Stephan,

thanks for your reply.
In fact tycho was the solution that I was implementing in order to try to fix the issue.

Many thanks

Simone
Previous Topic:Call Hierarchy not showing up in Debug Perspective
Next Topic:Eclipse Mars: Archive for required library: <JAR-file-Path> in project <My-Project-name>
Goto Forum:
  


Current Time: Fri Apr 18 09:17:27 EDT 2025

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

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

Back to the top