Target Definition and deployed plugins = class path problem in build.xml [message #44649] |
Wed, 04 February 2009 04:54  |
Eclipse User |
|
|
|
Hello,
i have an rcp application, for which i try to set up an target definition.
In these target definition i include the rcp delta pack AND some own
plugins. These own plugins are mainly wrapping a library and have
additionally rcp classes.
To use these plugins in my target definition i do an export of the plugins
(Export-> PDE -> deployable plugins) and deploy it into an special folder
of my workspace. These folder(s) i have added to my target definitnion
file.
Now the problem:
First try: When i export these plugins as jar's (and set the target
definition for my workspace), then the eclipse compiler moans, that he
cannot find the classes of the wrapped library inside the plugin.jar. (My
workspace is getting red due to of missing library classes)
Second try: But when i export these plugins as pure directory (not jar'ed)
the eclipse compiler finds the classes inside the wrapped jar, but i'm
getting problem when doing an product export of my whole project. The
Product Export (or ant build) now doesn't find the plugin classes of the
deployed plugins!
The ant build of my product log these failures:
[javac] The import com.xyz.my.deployed.plugin.rcp cannot be resolved
Summary:
exporting my library wrapping plugins as jar -> the eclipse compiler
doesn't find the classes of the jar's inside the plugin
exporting my library wrapping plugins as directory -> running the product
build by build.xml --> the javac-compiler doesn't find the wrapping plugin
classes.
What can i do ?
|
|
|
|
|
|
|
|
|
|
|
|
Re: Target Definition and deployed plugins = class path problem in build.xml [message #591301 is a reply to message #44649] |
Wed, 04 February 2009 05:24  |
Eclipse User |
|
|
|
I follow you use this new folder (referenced by your target definition) as
a target platform in your workspace?
If that's right you have to set this folder also as a target platform in
your build. Set the property 'baseLocation' (in any way) when you start
the headless eclipse build to the folder you use in your target platform.
-Matthias
S.Schnabl wrote:
> Hello,
> i have an rcp application, for which i try to set up an target definition.
> In these target definition i include the rcp delta pack AND some own
> plugins. These own plugins are mainly wrapping a library and have
> additionally rcp classes.
> To use these plugins in my target definition i do an export of the plugins
> (Export-> PDE -> deployable plugins) and deploy it into an special folder
> of my workspace. These folder(s) i have added to my target definitnion
> file.
> Now the problem:
> First try: When i export these plugins as jar's (and set the target
> definition for my workspace), then the eclipse compiler moans, that he
> cannot find the classes of the wrapped library inside the plugin.jar. (My
> workspace is getting red due to of missing library classes)
> Second try: But when i export these plugins as pure directory (not jar'ed)
> the eclipse compiler finds the classes inside the wrapped jar, but i'm
> getting problem when doing an product export of my whole project. The
> Product Export (or ant build) now doesn't find the plugin classes of the
> deployed plugins!
> The ant build of my product log these failures:
> [javac] The import com.xyz.my.deployed.plugin.rcp cannot be resolved
> Summary:
> exporting my library wrapping plugins as jar -> the eclipse compiler
> doesn't find the classes of the jar's inside the plugin
> exporting my library wrapping plugins as directory -> running the product
> build by build.xml --> the javac-compiler doesn't find the wrapping plugin
> classes.
> What can i do ?
|
|
|
Re: Target Definition and deployed plugins = class path problem in build.xml [message #591309 is a reply to message #44713] |
Wed, 04 February 2009 06:53  |
Eclipse User |
|
|
|
> If that's right you have to set this folder also as a target platform in
> your build. Set the property 'baseLocation' (in any way) when you start
> the headless eclipse build to the folder you use in your target platform.
Currently there we are not doing an headless build. I simply use the
genereated build.xml when you do right click on plugin.xml -> PDE Tools ->
Create Ant Build File.
Is there a way to tweak the build.xml file ? Or must i define this
property explicitly in the build.properties tab ?
|
|
|
Re: Target Definition and deployed plugins = class path problem in build.xml [message #591322 is a reply to message #44742] |
Wed, 04 February 2009 07:21  |
Eclipse User |
|
|
|
If you run your build.xml in an eclipse you have to be sure your target
platform is set up correct ;)
When you generate an build.xml of a plugin it contains a @dot.classpath
(target @dot) where all required plugins and their paths are listed. Check
them and look for the path of the bundle which contains the package
'com.xyz.my.deployed.plugin.rcp'.
If everything is set up right check this bundle if the manifest is ok...
This is an example of a Manifest from a bundle which wrapps commons-lang:
Manifest-Version: 1.0
Bundle-Name: commons_lang
Bundle-ClassPath: lib/commons-lang.jar
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-Vendor: rtc.ch
Bundle-ManifestVersion: 2
Bundle-SymbolicName: ch.rtc.rosi.commons_lang
Export-Package: org.apache.commons.lang,org.apache.commons.lang.builde
r,org.apache.commons.lang.enums,org.apache.commons.lang.exce ption,org
.apache.commons.lang.math,org.apache.commons.lang.mutable,or g.apache.
commons.lang.text,org.apache.commons.lang.time
Bundle-Version: 2.2.0.200902032205
The referenced path in @dot.classpath contains
'eclipse/plugins/ch.rtc.rosi.commons_lang_2.2.0.200902032205 /lib/commons-lang.jar'
Rhodan76 wrote:
>> If that's right you have to set this folder also as a target platform in
>> your build. Set the property 'baseLocation' (in any way) when you start
>> the headless eclipse build to the folder you use in your target platform.
> Currently there we are not doing an headless build. I simply use the
> genereated build.xml when you do right click on plugin.xml -> PDE Tools ->
> Create Ant Build File.
> Is there a way to tweak the build.xml file ? Or must i define this
> property explicitly in the build.properties tab ?
|
|
|
Re: Target Definition and deployed plugins = class path problem in build.xml [message #591328 is a reply to message #44802] |
Wed, 04 February 2009 07:42  |
Eclipse User |
|
|
|
the @dot class path in build.xml looks like:
<pathelement path="../Deployed Plugins
Folder/plugins/com.xyz.my.deployed.plugin.rcp_2.1.10/@dot"/ >
<pathelement path="../Deployed Plugins
Folder/plugins/com.xyz.my.deployed.plugin.rcp_2.1.10/lib/apa che/commons-math-1.2.jar "/>
<pathelement path="../Deployed Plugins
Folder/plugins/com.xyz.my.deployed.plugin.rcp_2.1.10/lib/apa che/commons-codec-1.3.jar "/>
Also the bundle classpath in MANIFEST.MF looks ok:
Bundle-ClassPath: .,
lib/apache/commons-math-1.2.jar,
lib/apache/commons-codec-1.3.jar
I think that i correctly set the target platform (aka. definition). In my
Eclipse Workbench all is ok after setting the target platform.
Only the build (regardles of doing an .product-file build) or only by
build.xml fails with:
[javac] The import com.xyz.plugin.rcp cannot be resolved
|
|
|
|
Re: Target Definition and deployed plugins = class path problem in build.xml [message #591341 is a reply to message #44828] |
Wed, 04 February 2009 08:27  |
Eclipse User |
|
|
|
I see your problem; your plugin com.xyz.my.deployed.plugin.rcp_2.1.10
contains additional jars and your own code.
Take the build.properties of the com.xyz.my.deployed.plugin.rcp plugin and
add the following:
bin.includes = META-INF/,\
commons-codec-1.3.jar,\
commons-math-1.2.jar
source.com.xyz.my.deployed.plugin.rcp.jar = src
(where 'src' must be your source directory which contains your own code.
This must create an additional jar with your code.)
Manifest:
Bundle-ClassPath: commons-codec-1.3.jar,
commons-math-1.2.jar,
com.xyz.my.deployed.plugin.rcp.jar
Export the plugin com.xyz.my.deployed.plugin.rcp again in your Deployed
Plugins Folder; generate the build.xml once again. Now the line
<pathelement path="../Deployed Plugins
Folder/plugins/com.xyz.my.deployed.plugin.rcp_2.1.10/@dot"/ > will look
like <pathelement path="../Deployed Plugins
Folder/plugins/com.xyz.my.deployed.plugin.rcp_2.1.10/com.xyz .my.deployed.plugin.rcp.jar "/>
hopefully that's the solution ;)
S.Schnabl wrote:
> the @dot class path in build.xml looks like:
> <pathelement path="../Deployed Plugins
> Folder/plugins/com.xyz.my.deployed.plugin.rcp_2.1.10/@dot"/ >
> <pathelement path="../Deployed Plugins
>
Folder/plugins/com.xyz.my.deployed.plugin.rcp_2.1.10/lib/apa che/commons-math-1.2.jar "/>
> <pathelement path="../Deployed Plugins
>
Folder/plugins/com.xyz.my.deployed.plugin.rcp_2.1.10/lib/apa che/commons-codec-1.3.jar "/>
> Also the bundle classpath in MANIFEST.MF looks ok:
> Bundle-ClassPath: .,
> lib/apache/commons-math-1.2.jar,
> lib/apache/commons-codec-1.3.jar
> I think that i correctly set the target platform (aka. definition). In my
> Eclipse Workbench all is ok after setting the target platform.
> Only the build (regardles of doing an .product-file build) or only by
> build.xml fails with:
> [javac] The import com.xyz.plugin.rcp cannot be resolved
|
|
|
|
Re: Target Definition and deployed plugins = class path problem in build.xml [message #591450 is a reply to message #44901] |
Thu, 05 February 2009 02:04  |
Eclipse User |
|
|
|
If you generate an build.xml he asumes that if you require a bundle which
exists as a folder and contains source that he can build this bundle and
reference the '@dot' folder.
BUT you already have build this bundle and it only contains .class files
and these .jar's. So there is no @dot folder.
And unnoted by that fact it's good practise to pack .class files in a jar
;-) not in a folder.
Rhodan76 wrote:
> Yeah, great. That works ! But i didn't really understand why ;-)
> Please explain me, what we are doing here - i can only see, that an
> additionally jar consisting my classes has been created.
|
|
|
|
Powered by
FUDForum. Page generated in 0.06723 seconds