Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 166864 - splitted ant (>=dev-java/ant-core-1.7.0) breaks PropertyFile support in eclipse-sdk
Summary: splitted ant (>=dev-java/ant-core-1.7.0) breaks PropertyFile support in eclip...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-14 17:00 UTC by Robert Schultz
Modified: 2007-03-30 14:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Schultz 2007-02-14 17:00:32 UTC
I have ~x86 and ~amd64 set.
I installed the latest eclipse-sdk package which also included ant/ant-core/ant-tasks

The build finished fine, but when I attempted to run an ant build.xml inside of eclipse that used the optional ant task PropertyFile I got an error:

class org.apache.tools.ant.taskdefs.optional.PropertyFile was not found

It pointed me to look at:
/usr/lib64/eclipse-3.2/plugins/org.apache.ant_1.6.5/lib

I noticed at this point that the plugin seems to be based on ant 1.6.5 yet the ant chosen by portage when emerging eclipse-sdk was ant 1.7.*

So I added to my package.mask:
>dev-java/ant-1.6.6
>dev-java/ant-core-1.6.6
>dev-java/ant-tasks-1.6.6

I then did emerge -C ant ant-core ant-tasks
And then remerged them back in.
I then did a recompile emerge on eclipse-sdk `emerge eclipse-sdk`

Now the ant scripts work with PropertyFile and the directory noted above contains a lot more jars than it did before.


Reproducible: Didn't try
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2007-02-14 17:31:32 UTC
My guess on what happens with the new splitted ant:
In splitted ant the /usr/bin/ant wrapper puts all the optional ant jars to CLASSPATH and there is not a unified directory (ant home) any more where all these live. Eclipse is most likely using the ant classes directly and as such the optional jars like ant-nodeps.jar where the PropertyFile task lives are not in classpath. I think to solve this we could modify the eclipse launcher to put all installed ant tasks to CLASSPATH.

Is the build.xml you were trying to use something eclipse-sdk generated or something external?
Comment 2 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-02-14 18:51:45 UTC
Or do some symlinkfest in, say /usr/share/ant/lib, and point ANT_HOME into /usr/share/ant
Comment 3 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-02-14 19:03:50 UTC
How bout this:
ant-core installs /etc/env.d/20ant which sets ANT_HOME to /usr/share/ant-core
(NEW) ant-tasks would install /etc/env.d/21ant which would override ANT_HOME with /usr/share/ant. it would also symlink all jars from core and tasks into /usr/share/ant/lib

- ant script doesn't care, it sets ANT_HOME to /usr/share/ant-core anyway
- stuff that doesn't use the script but looks in ANT_HOME/lib would find everything there
- except of course dependencies of the tasks, but that's life (any better idea for this?)

so the only thing that would need changing is ant-tasks
Comment 4 Robert Schultz 2007-02-14 22:32:24 UTC
(In reply to comment #1)
> 
> Is the build.xml you were trying to use something eclipse-sdk generated or
> something external?
> 

The build.xml was external, so no additional concern there.
Comment 5 Petteri Räty (RETIRED) gentoo-dev 2007-03-08 14:19:46 UTC
(In reply to comment #4)
> (In reply to comment #1)
> > 
> > Is the build.xml you were trying to use something eclipse-sdk generated or
> > something external?
> > 
> 
> The build.xml was external, so no additional concern there.
> 

Can you attach a sample build.xml to test with?
Comment 6 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-03-11 00:29:52 UTC
What exactly version of eclipse-sdk? The one from tree or overlay? How bout emerge --info?
Also, were you using split-ant-overlay at some point? The ant-tasks-1.7.0.ebuild was incomplete there until some point, but when it was added to main tree it was already complete in a sense that eclipse-sdk ebuild should fill the /usr/lib64/eclipse-3.2/plugins/org.apache.ant_1.6.5/lib directory with all jars, not just the core two.

Because I just did what proposed in comment 3 and realized eclipse isn't using ANT_HOME var, but knows only of jars symlinked in that abovementioned directory when emerging. This means one has to remerge eclipse-sdk after upgrade to split-ant to get the symlinks right, but it should work afterwards.
Comment 7 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-03-28 09:36:59 UTC
Ah, found the cause. ant-tasks was not registering ant-nodeps into its package.env, so java_pkg-jar-from ant-tasks didn't make a symlink to ant-nodeps.jar which contains PropertyFile. Fixed in ant-tasks-1.7.0-r2. Note that you need to remerge eclipse-sdk after upgrading ant-tasks, to put the change in effect. 
Comment 8 Robert Schultz 2007-03-30 14:24:05 UTC
Cool, glad it is resolved. Sorry I didn't get back with the examples/information that was requested. (I got my first girlfriend ever about 6 weeks ago, only took me 28 years to do this (typical geek fashion) but needless to say I've had other priorities recently)