Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies from external JAR's META-INF/MANIFEST.MF not propagated to Eclipse? #834

Closed
Matschbirne86 opened this issue Dec 23, 2018 · 3 comments

Comments

@Matschbirne86
Copy link

Hi there,

I got the following build.gradle file:

plugins {
    // Apply the groovy plugin to add support for Groovy
    id 'groovy'		
}


dependencies {

    compile project(':PwUtil')
		
    compile files(':oracle.odi-sdk-jse')
    compile ':oracle.jdbc/ojdbc8'

    testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
}

repositories {

	mavenCentral()
	
	flatDir {
		dirs "D:\\Programme\\Oracle\\Middleware\\Oracle_Home\\oracle_common\\modules", "D:\\Programme\\Oracle\\Middleware\\Oracle_Home\\odi\\sdk\\lib"
	}
}

My source uses some Classes from external JAR oracle.odi-sdk-jse.jar in "D:\Programme\Oracle\Middleware\Oracle_Home\odi\sdk\lib", which is a JAR containing only a META-INF/MANIFEST.MF which references lots of jars relative to the jar, e.g. (not complete):

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.2
Created-By: 1.8.0_40-ea-b19 (Oracle Corporation)
Extension-Name: oracle.odi-sdk
Specification-Version: 2.0
Implementation-Version: 12.2.1
Oracle-Version: 12.2.1
Class-Path: odi-core.jar odi-sap.jar odi-wls-template-gen.jar odihapp_
 common.jar odihapp_essbase.jar odihapp_planning.jar ogg_jmx_interface
 .jar oracle.odi-jaxrsri.jar XmlSchema-1.4.2.jar activation.jar aopall
 iance.jar bsf.jar commons-beanutils-1.7.0.jar commons-codec-1.3.jar c
 ommons-codec-1.9.jar commons-discovery-0.4.jar commons-lang-2.2.jar c
 ommons-logging-1.1.1.jar commons-logging-1.2.jar commons-net-3.3.jar

Now compiling on commandline works just fine, the build finished successfully. The problem arises when importing the gradle project to eclipse. The jar is correctly listed

image

but my code shows "Unable to resolve" errors in Eclipse as the MANIFESTs entries do net get imported, it seems to me. To verify I'm not missing a point, I created a second testproject for which I included all required libraries using "Add external jar" in build path configuration. After adding the oracle.odi-sdk-jse.jar this way, eclipse list "Referenced Libraries" in the project view, which it does NOT for the gradle imported object:

image

With this configuration, everything works fine in Eclipse and my code compiles successfully. Thanks in advance for any hint.

Regards
Matschbirne86

@Matschbirne86
Copy link
Author

Btw, in the Test-Project, the externally added JAR is listed like this in the builpath configuration:

image

@Matschbirne86
Copy link
Author

Further findings:

When disabling automatic project synchronisation and adding the external JAR to the eclipse project (to clarify: I'm talking about the project that has the problems, not my second "Test" project) manually, it works in this order

image

but not when placing the JAR below "Project and external Dependencies":

image

Any suggestions?

@donat
Copy link
Contributor

donat commented Jan 21, 2019

If I understand correctly your initial report, you're trying to make an OSGi project work in Eclipse.

The bad news is that Buildship doesn't provide any support for OSGi development out-of-the-box. My guess is that on the command line Gradle simply ignores the manifest entries as it doesn't know anything about it without a proper plugin. On the other hand in Eclipse you already have PDE installed which recognizes the OSGi headers and complains about the missing dependencies.

You might be able to configure PDE and JDT to work correctly, but it's certainly not easy. Even Buildship doesn't use itself to import the source code into the workspace, even though it's built with Gradle on the command line.

@donat donat closed this as completed Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants