Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Headless build not adding jars from binary plug-ins to build path?
Headless build not adding jars from binary plug-ins to build path? [message #57559] Tue, 21 April 2009 21:33 Go to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
I'm trying to set up a headless Ant build for an RCP product, but end up
with the following compilation error:

[javac] Compilation arguments:
[javac] '-noExit'
[javac] '-bootclasspath'
[javac] '...'
[javac] '-classpath'
[javac]
'...;c:\build\plugins\com.springsource.slf4j.api[+org/slf4j/ *;?**/*];'
...
[javac] 1. ERROR in c:\build\plugins\foo.test\src\test\foo\Bar.java (at
line 6)
[javac] import org.slf4j.Logger;
[javac] ^^^^^^^^^
[javac] The import org.slf4j cannot be resolved

The "missing" class/package is here:

> jar -tf
c:\build\plugins\com.springsource.slf4j.api\com.springsource .slf4j.api-1.5.0.jar
...
org/slf4j/Logger.class
...

Also, com.springsource.slf4j.api-1.5.0.jar:META-INF/MANIFEST.MF includes
the following entries:

Bundle-Classpath: com.springsource.slf4j.api-1.5.0.jar
Export-Package: org.slf4j;version="1.5.0";...

Any ideas what's going wrong here? The product builds fine in Eclipse...
Re: Headless build not adding jars from binary plug-ins to build path? [message #57711 is a reply to message #57559] Wed, 22 April 2009 14:33 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Eric Jain wrote:
> I'm trying to set up a headless Ant build for an RCP product, but end up
> with the following compilation error:
>
> [javac] Compilation arguments:
> [javac] '-noExit'
> [javac] '-bootclasspath'
> [javac] '...'
> [javac] '-classpath'
> [javac]
> '...;c:\build\plugins\com.springsource.slf4j.api[+org/slf4j/ *;?**/*];'

It looks like build is considering
"c:\build\plugins\com.springsource.slf4j.api" to be the bundle and not
" c:\build\plugins\com.springsource.slf4j.api\com.springsource .slf4j.api-1.5.0.jar "

What does
c:\build\plugins\com.springsource.slf4j.api/META-INF/MANIFES T.MF say
about Bundle-Classpath?


> Also, com.springsource.slf4j.api-1.5.0.jar:META-INF/MANIFEST.MF includes
> the following entries:
>
> Bundle-Classpath: com.springsource.slf4j.api-1.5.0.jar
> Export-Package: org.slf4j;version="1.5.0";...
This looks wrong to me, unless com.springsource.slf4j.api-1.5.0.jar
contains another com.springsource.slf4j.api-1.5.0.jar. This is what the
outer " c:\build\plugins\com.springsource.slf4j.api/META-INF/MANIFES T.MF "
should say. If this inner jar is a bundle in its own right, it should
say "Bundle-Classpath: ." since the classes are in the root of the jar.

>
> Any ideas what's going wrong here? The product builds fine in Eclipse...
>
>
Re: Headless build not adding jars from binary plug-ins to build path? [message #57784 is a reply to message #57711] Wed, 22 April 2009 18:01 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Andrew Niefer wrote:
> This looks wrong to me, unless com.springsource.slf4j.api-1.5.0.jar
> contains another com.springsource.slf4j.api-1.5.0.jar. This is what the
> outer " c:buildpluginscom.springsource.slf4j.api/META-INF/MANIFEST.M F "
> should say. If this inner jar is a bundle in its own right, it should
> say "Bundle-Classpath: ." since the classes are in the root of the jar.

Sorry: The MANIFEST.MF in com.springsource.slf4j.api-1.5.0:META-INF (not
the one in the jar) contains the two entries I mentioned:

Bundle-Classpath: com.springsource.slf4j.api-1.5.0.jar
Export-Package: org.slf4j;version="1.5.0";...

The MANIFEST.MF inside the jar doesn't have a Bundle-Classpath, but it
exports the same package.

If I unpack the jar inside its project, the classes are picked up. So
either headless builds (unlike builds in Eclipse) don't support
Bundle-Classpath, or I'm doing something wrong?
Re: Headless build not adding jars from binary plug-ins to build path? [message #57905 is a reply to message #57784] Thu, 23 April 2009 14:43 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
The headless build does support Bundle-Classpath, I don't really have
any idea why it isn't working here. The only case where this doesn't
apply is jars nested in jars because the compiler doesn't support that
kind of classpath entry.

This is the kind of thing I would almost need to run through a debugger
to see what is going wrong. (If you were ambitious, the code is
org.eclipse.pde.build/ClasspathComputer3_0#addPathAndCheck)

-Andrew

Eric Jain wrote:
> Andrew Niefer wrote:
>> This looks wrong to me, unless com.springsource.slf4j.api-1.5.0.jar
>> contains another com.springsource.slf4j.api-1.5.0.jar. This is what
>> the outer
>> " c:buildpluginscom.springsource.slf4j.api/META-INF/MANIFEST.M F " should
>> say. If this inner jar is a bundle in its own right, it should say
>> "Bundle-Classpath: ." since the classes are in the root of the jar.
>
> Sorry: The MANIFEST.MF in com.springsource.slf4j.api-1.5.0:META-INF (not
> the one in the jar) contains the two entries I mentioned:
>
> Bundle-Classpath: com.springsource.slf4j.api-1.5.0.jar
> Export-Package: org.slf4j;version="1.5.0";...
>
> The MANIFEST.MF inside the jar doesn't have a Bundle-Classpath, but it
> exports the same package.
>
> If I unpack the jar inside its project, the classes are picked up. So
> either headless builds (unlike builds in Eclipse) don't support
> Bundle-Classpath, or I'm doing something wrong?
>
>
Re: Headless build not adding jars from binary plug-ins to build path? [message #58152 is a reply to message #57905] Fri, 24 April 2009 04:25 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Andrew Niefer wrote:
> The headless build does support Bundle-Classpath, I don't really have
> any idea why it isn't working here. The only case where this doesn't
> apply is jars nested in jars because the compiler doesn't support that
> kind of classpath entry.

> This is the kind of thing I would almost need to run through a debugger
> to see what is going wrong. (If you were ambitious, the code is
> org.eclipse.pde.build/ClasspathComputer3_0#addPathAndCheck)

The javac classpath (as echoed by Ant) contained the following entry;
there is no indication that it is looking at any jar file?

c:\build\plugins\com.springsource.slf4j.api[+org/slf4j/*;?** /*]

In any case I dropped the binary plug-in projects and now deploy the jars
into the target platform; this way the headless build completes without an
error.
Re: Headless build not adding jars from binary plug-ins to build path? [message #512388 is a reply to message #58152] Thu, 04 February 2010 21:33 Go to previous messageGo to next message
Thomas is currently offline ThomasFriend
Messages: 2
Registered: February 2010
Junior Member
I just ran into the exact same problem and it seems that by changing "Bundle-Classpath" into "Bundle-ClassPath" (uppercase 'P') in the required plugin manifest (the equivalent for me of the com.springsource.slf4j.api-1.5.0.jar:META-INF/MANIFEST.MF in this example) then it is working.
Does that make sense?

Based on the OSGI R4 spec (r4.core.pdf), it does not seem that the Bundle-Classpath should be with an uppercase 'P'. But when looking through the pde source code, it seems that the org.osgi.framework.Constants.BUNDLE_CLASSPATH is used to get the classpath from the manifest and this constant is using uppercase 'P'......

Re: Headless build not adding jars from binary plug-ins to build path? [message #596110 is a reply to message #57559] Wed, 22 April 2009 14:33 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
Eric Jain wrote:
> I'm trying to set up a headless Ant build for an RCP product, but end up
> with the following compilation error:
>
> [javac] Compilation arguments:
> [javac] '-noExit'
> [javac] '-bootclasspath'
> [javac] '...'
> [javac] '-classpath'
> [javac]
> '...;c:\build\plugins\com.springsource.slf4j.api[+org/slf4j/ *;?**/*];'

It looks like build is considering
"c:\build\plugins\com.springsource.slf4j.api" to be the bundle and not
" c:\build\plugins\com.springsource.slf4j.api\com.springsource .slf4j.api-1.5.0.jar "

What does
c:\build\plugins\com.springsource.slf4j.api/META-INF/MANIFES T.MF say
about Bundle-Classpath?


> Also, com.springsource.slf4j.api-1.5.0.jar:META-INF/MANIFEST.MF includes
> the following entries:
>
> Bundle-Classpath: com.springsource.slf4j.api-1.5.0.jar
> Export-Package: org.slf4j;version="1.5.0";...
This looks wrong to me, unless com.springsource.slf4j.api-1.5.0.jar
contains another com.springsource.slf4j.api-1.5.0.jar. This is what the
outer " c:\build\plugins\com.springsource.slf4j.api/META-INF/MANIFES T.MF "
should say. If this inner jar is a bundle in its own right, it should
say "Bundle-Classpath: ." since the classes are in the root of the jar.

>
> Any ideas what's going wrong here? The product builds fine in Eclipse...
>
>
Re: Headless build not adding jars from binary plug-ins to build path? [message #596146 is a reply to message #57711] Wed, 22 April 2009 18:01 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Andrew Niefer wrote:
> This looks wrong to me, unless com.springsource.slf4j.api-1.5.0.jar
> contains another com.springsource.slf4j.api-1.5.0.jar. This is what the
> outer " c:buildpluginscom.springsource.slf4j.api/META-INF/MANIFEST.M F "
> should say. If this inner jar is a bundle in its own right, it should
> say "Bundle-Classpath: ." since the classes are in the root of the jar.

Sorry: The MANIFEST.MF in com.springsource.slf4j.api-1.5.0:META-INF (not
the one in the jar) contains the two entries I mentioned:

Bundle-Classpath: com.springsource.slf4j.api-1.5.0.jar
Export-Package: org.slf4j;version="1.5.0";...

The MANIFEST.MF inside the jar doesn't have a Bundle-Classpath, but it
exports the same package.

If I unpack the jar inside its project, the classes are picked up. So
either headless builds (unlike builds in Eclipse) don't support
Bundle-Classpath, or I'm doing something wrong?
Re: Headless build not adding jars from binary plug-ins to build path? [message #596209 is a reply to message #57784] Thu, 23 April 2009 14:43 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew NieferFriend
Messages: 990
Registered: July 2009
Senior Member
The headless build does support Bundle-Classpath, I don't really have
any idea why it isn't working here. The only case where this doesn't
apply is jars nested in jars because the compiler doesn't support that
kind of classpath entry.

This is the kind of thing I would almost need to run through a debugger
to see what is going wrong. (If you were ambitious, the code is
org.eclipse.pde.build/ClasspathComputer3_0#addPathAndCheck)

-Andrew

Eric Jain wrote:
> Andrew Niefer wrote:
>> This looks wrong to me, unless com.springsource.slf4j.api-1.5.0.jar
>> contains another com.springsource.slf4j.api-1.5.0.jar. This is what
>> the outer
>> " c:buildpluginscom.springsource.slf4j.api/META-INF/MANIFEST.M F " should
>> say. If this inner jar is a bundle in its own right, it should say
>> "Bundle-Classpath: ." since the classes are in the root of the jar.
>
> Sorry: The MANIFEST.MF in com.springsource.slf4j.api-1.5.0:META-INF (not
> the one in the jar) contains the two entries I mentioned:
>
> Bundle-Classpath: com.springsource.slf4j.api-1.5.0.jar
> Export-Package: org.slf4j;version="1.5.0";...
>
> The MANIFEST.MF inside the jar doesn't have a Bundle-Classpath, but it
> exports the same package.
>
> If I unpack the jar inside its project, the classes are picked up. So
> either headless builds (unlike builds in Eclipse) don't support
> Bundle-Classpath, or I'm doing something wrong?
>
>
Re: Headless build not adding jars from binary plug-ins to build path? [message #596318 is a reply to message #57905] Fri, 24 April 2009 04:25 Go to previous messageGo to next message
Eric Jain is currently offline Eric JainFriend
Messages: 266
Registered: July 2009
Senior Member
Andrew Niefer wrote:
> The headless build does support Bundle-Classpath, I don't really have
> any idea why it isn't working here. The only case where this doesn't
> apply is jars nested in jars because the compiler doesn't support that
> kind of classpath entry.

> This is the kind of thing I would almost need to run through a debugger
> to see what is going wrong. (If you were ambitious, the code is
> org.eclipse.pde.build/ClasspathComputer3_0#addPathAndCheck)

The javac classpath (as echoed by Ant) contained the following entry;
there is no indication that it is looking at any jar file?

c:\build\plugins\com.springsource.slf4j.api[+org/slf4j/*;?** /*]

In any case I dropped the binary plug-in projects and now deploy the jars
into the target platform; this way the headless build completes without an
error.
Re: Headless build not adding jars from binary plug-ins to build path? [message #604515 is a reply to message #58152] Thu, 04 February 2010 21:33 Go to previous message
Thomas is currently offline ThomasFriend
Messages: 2
Registered: February 2010
Junior Member
I just ran into the exact same problem and it seems that by changing "Bundle-Classpath" into "Bundle-ClassPath" (uppercase 'P') in the required plugin manifest (the equivalent for me of the com.springsource.slf4j.api-1.5.0.jar:META-INF/MANIFEST.MF in this example) then it is working.
Does that make sense?

Based on the OSGI R4 spec (r4.core.pdf), it does not seem that the Bundle-Classpath should be with an uppercase 'P'. But when looking through the pde source code, it seems that the org.osgi.framework.Constants.BUNDLE_CLASSPATH is used to get the classpath from the manifest and this constant is using uppercase 'P'......
Previous Topic:updating menu contributions from editor state
Next Topic:PDE Headless Build doesn't work with feature
Goto Forum:
  


Current Time: Sat Apr 20 03:34:40 GMT 2024

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

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

Back to the top