-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: Build for hibernate-3.0 fails
PostPosted: Wed Mar 16, 2005 5:52 am 
Beginner
Beginner

Joined: Fri Mar 11, 2005 7:52 am
Posts: 34
Hibernate version: 3.0

I am looking for a way to use (Borland) JDatastore with Hibernate. The JIRA (http://opensource.atlassian.com/projects/hibernate/) contains HHH-224 which contains a fix for JDatastore. Now I want to compile the 3.0 distribution with the extra functionality. But the ANT build for the dustribution fails:

Code:
C:\projects\hibernate-3.0>ant jar
Buildfile: build.xml

BUILD FAILED
C:\projects\hibernate-3.0\build.xml:110: taskdef A class needed by class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be found: junit/framework/Test


What do I have to do to build hibernate-3.0?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 5:31 am 
Regular
Regular

Joined: Wed Feb 02, 2005 6:33 am
Posts: 70
When I got this error, found that I had to remove the junit bundled with the recent versions of ant in order to get the hibernate-3.0 build going. Take a look in ANT_HOME/lib for the junit library, and if it's there, move it somewhere else temporarily and try the build again.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 5:50 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This is a well known packaging error in Ant, which the Ant developers don't seem to worry about. There is a FAQ entry on the Ant website about it.

Distributing the plugin stubs in ANT_HOME/lib makes it impossible to use plugins outside of Ant - without copying other libraries such as junit.jar to ANT_HOME/lib or deleting the ant-junit.jar stub from there.

It's probably a good idea if you tell the Ant developers how long it took you to figure that out. We already tried IIRC.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 6:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
using our build.bat/build.sh solves this as it gives the arguments to ant to use the libs in our lib directory.

but it still is bad packaging in ant from my perspective - so go pay them a visit ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: build hibernate 3.0
PostPosted: Thu Mar 17, 2005 6:56 am 
Beginner
Beginner

Joined: Fri Mar 11, 2005 7:52 am
Posts: 34
Yes with apache-ant-1.6.2 I had to rename:

Quote:
ant-junit.jar
ant-antlr.jar


from the lib directory. Next to this I had to set a path to to:

Quote:
C:\j2sdk1.4.2_06\bin


For the javac compiler. This is strange because all other projects build with ANT without this settings...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 7:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
where did you have to rename that ?
and what path did you have to set ?

And I dont know of any project that uses junit that can build without either poluting your local ant install with a junit.jar (some uses different versions of junit so this is bad) or by overruling ants packaging via the -lib path.

(you can also globally set the CLASSPATH environment, but thats also just a hack in my book)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 7:12 am 
Beginner
Beginner

Joined: Fri Mar 11, 2005 7:52 am
Posts: 34
max wrote:
where did you have to rename that ?
and what path did you have to set ?

And I dont know of any project that uses junit that can build without either poluting your local ant install with a junit.jar (some uses different versions of junit so this is bad) or by overruling ants packaging via the -lib path.

(you can also globally set the CLASSPATH environment, but thats also just a hack in my book)


I had to rename:

Quote:
ant-junit.jar
ant-antlr.jar


from:

Quote:
C:\apache-ant-1.6.2\lib


But this was the thing you already mentioned. The strange thing I was talking about was the fact that I had to set a path to the Javac compiler:

Quote:
C:\j2sdk1.4.2_06\bin


Strange to me because ANT already knows the position from the Java distribution from the JAVA_HOME setting. Hibernate was the first ANT project for me which was complaining about a 'missing' Javac compiler...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 7:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
rename it to what ?

and did you use build.bat or ants ant.bat ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 8:06 am 
Beginner
Beginner

Joined: Fri Mar 11, 2005 7:52 am
Posts: 34
max wrote:
rename it to what ?

and did you use build.bat or ants ant.bat ?


rename to delete something as:

Quote:
ant-junit.jar.renamed


for building I used ANT jar (ant version: apache-ant-1.6.2)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 8:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - that rename is basically what the ant team should do ,)
remove the ant-junit from the main dist or make it in some other way so it can pick up the junit or whatever other library a project depends on.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 9:46 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
I use plain <java fork="true"/> task to run tests (it helps to "isolate" any stuff from ant), but it doe's not generate reports.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 9:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - but doing that for every java related library basically makes all the ant tasks not needed....so why even include them in the distribution ?

so funny ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.