David Corley (AT/LMI | 1 Mar 14:48 2007
Picon

Specifying additonal classpath elements when calling the <ant> task

I'm wondering if anyone knows a way to specify additional jars for use
by an <ant> task within an ant buildfile.

My current setup involves 2 build files, builda.xml and buildb.xml.
Builda.xml runs an <ant> task to kick-off buildb.xml.  This a
multiproject setup. 
There are many users having their own custom builda.xml, but they all
call the same buildb.xml.

The problem is this:
In buildb.xml, I make use of Ant's <mail> task, which requires the
javamail and jaf jars from sun. From what I can tell, the only way to
get them on the classpath is to either:
A) add from the command line with -lib
B) drop them into the /ant/lib directory.

Neither of the above is entirely practical for our setup. We would have
to change every build script for the -lib option, and not every user
uses the same ant installation, so dropping the jars into the ant/lib
directory isn't entirely practical, as well as the fact we want to
separate 3rd party jars for version control purposes.

So basically, I'd like to run my buildb.xml and specify additional jars
to be added to it's classpath that are not in builda.xml.
(I know I can use inheritall/inheritref attributes in the <ant> task and
specify the jars in the builda classpath, but I specifically only want
the jars to be used by buildb)

An suggestions/ideas?

(Continue reading)

Steve Loughran | 1 Mar 14:54 2007
Picon

Re: [Junit] How to handle TestSuites correctly

Anton Vodonosov wrote:
>>> From what I understand from documentation, it is impossible
>>> to create Resource Collection based on classpath. Am I right?
>>>
> 
>> that's right, because there is nothing in the Java API to enum all 
>> classes in a package.
> 
> Yes, but it is possible to analyze classpath programmatically: 
> for jars enum archive content, for directories - directory content
>  
>> 1. unzip the specific jars you want to test against, then create a 
>> <batchtest> batch from that
> 
> The point is that in different situations it may be different 
> classpath: either directory(-ies) with class files if junit 
> task is runned against compiled sources, or .jars if we run 
> tests against distributed version.
> 
>> 2. look at testng, which runs junit 3 tests and is driven by its 
>> own xml file
> 
> In my case I already have many junit 4 tests. But they weren't 
> runned automatically before. Now I want setup continuous 
> integration.
> 
> In either case I'll manage to do it and have reports in the 
> most preferred form for me. I just want to implement it most 
> elegant, simple and flexible way. It's to be regretted that 
> information is lost when TestSutes are used...
(Continue reading)

jake_ryan | 1 Mar 17:01 2007
Picon

Ant filterset doesnot work


I have a property file-1 where cc.db.username and cc.db.password are defined.

There is property file-2 with tokens DbUser and DbPassword with some default
values, that will be copied to a directory.

My task is to replace values of DbUser and DbPassword in file-2 with values
of cc.db.username and cc.db.password in file-1.

I have a code like this:

After running ant, I get successful message but still the copied file
contain old values.
How to debug this? What is wrong with my code?

Thanks a bunch!
--

-- 
View this message in context: http://www.nabble.com/Ant-filterset-doesnot-work-tf3327767.html#a9252339
Sent from the Ant - Users mailing list archive at Nabble.com.
jake_ryan | 1 Mar 17:13 2007
Picon

Re: [SEC=UNCLASSIFIED] Ant filterset doesnot work


Forgot to mention.. Here are the files:
file-1:
cc.db.username=itsme
cc.db.password=itsme

file-2
DbUser=shared
DbPassword=shared

After running ant, still I see DbUser and DbPassword as shared/shared. I
expected they wouldbe itsme/itsme.

I tried to use begintoken="%" endtoken="*" aswell, but of no use.

jake_ryan wrote:
> 
> I have a property file-1 where cc.db.username and cc.db.password are
> defined.
> 
> There is property file-2 with tokens DbUser and DbPassword with some
> default values, that will be copied to a directory.
> 
> My task is to replace values of DbUser and DbPassword in file-2 with
> values of cc.db.username and cc.db.password in file-1.
> 
> I have a code like this:
>        <echo message="Copying SPP_CC config file to
> ${jboss.local.conf.dir}"></echo>
>        <copy file="${cc.config.files.dir}/SPP_CC_Config.properties"
(Continue reading)

Michael Giroux | 1 Mar 18:21 2007
Picon

<javadoc> reporting <at> TransactionAttribute is an unknown tag

I'm attempting to generate javadocs for code containing JDK 1.5 annotations.

I have specified source='1.5' but this does not eliminate the warnings.

What am I overlooking?

Thanks
Michael Giroux
Stephen Nesbitt | 1 Mar 18:51 2007

Re: How to best create environment specific properties in an applications property file using ANT

I consider it best practice to *never* incorporate runtime configuration 
information into a build. When asked to do so I also request that I be 
given a "way forward machine" that will peer into the future and tell me 
where it will be deployed.

Less flippantly, relying on "targeted" builds - builds specific to a given 
environment - is not scaleable (environments are always growing in my 
experience), aren't maintainable (someone always forgets to update all 
the configurations), aren't flexible (someone needs to test on a new, 
temporary environment right now and can't because a new configuration and 
build have to be created.).

-steve

Stephen Nesbitt
CM Architect/Lead
The Cobalt Group
snesbitt <at> cobaltgroup.com
x8271

On Tuesday 27 February 2007 2:48:35 am Steve Loughran wrote:

>
> You are moving beyond build-time stuff here into the broader problem of
> configuration management; you are trying at build time to pick a
> specific target installation, because, as we all know, that is exactly
> what you have to do.
>
> 1.  keep the separate files under SCM and at build time pick between
> them. Create WAR/EAR files with specific names if you want to reduce
(Continue reading)

Keith Hatton | 1 Mar 19:01 2007

RE: [SEC=UNCLASSIFIED] Ant filterset doesnot work

A favourite that trips me up is that the destination files are newer
than the source files, so no copy actually happens. Maybe you need to
add overwrite="true" to the <copy>?

Hope this helps,
Keith

-----Original Message-----
From: jake_ryan [mailto:srinadh0 <at> yahoo.com] 
Sent: 01 March 2007 16:14
To: user <at> ant.apache.org
Subject: Re: [SEC=UNCLASSIFIED] Ant filterset doesnot work

Forgot to mention.. Here are the files:
file-1:
cc.db.username=itsme
cc.db.password=itsme

file-2
DbUser=shared
DbPassword=shared

After running ant, still I see DbUser and DbPassword as shared/shared. I
expected they wouldbe itsme/itsme.

I tried to use begintoken="%" endtoken="*" aswell, but of no use.

jake_ryan wrote:
> 
> I have a property file-1 where cc.db.username and cc.db.password are 
(Continue reading)

Wayne Cannon | 1 Mar 19:20 2007

Re: [SEC=UNCLASSIFIED] Ant filterset doesnot work

... or use <copy>'s "preservelastmodified"  on the original <copy> so 
the copied file has the same time-stamp as the original.  To my way of 
thinking, this allows a more 'honest" appraisal of files.  --Wayne

Keith Hatton wrote:
> A favourite that trips me up is that the destination files are newer
> than the source files, so no copy actually happens. Maybe you need to
> add overwrite="true" to the <copy>?
>
> Hope this helps,
> Keith
>   
Chun Ji | 1 Mar 20:25 2007

Invoking Ant Procedures from tomcat ?


We have a project going on, which involves 20 developers, 2000+ java files, 3,000+ junit test cases and
ORACLE database. Every morning, there will be a cron job running ant to do the build and run these junit test
cases. It also sends the results to everyone.   

Our manager is looking for 0% failure for the junit tests, which is very difficult to reach. There is quite a
few time that Person A's changes causes the failure of Person B's Junit test cases!  

So we are just thinking if we could create an "object" to a web server to invoke these build and testing
targets in ant. Whoever commits some new changes, he may just need to "push a button" at the front-end, to
make sure the changes DO NOT break anything 

comments, ideas, examples ? 

Charlie, 

Omry Yadan | 1 Mar 20:28 2007
Picon

Re: Invoking Ant Procedures from tomcat ?

1. developers can use junit standlone test runner.

2. developers can use the junit ide integration (Eclispe has fantastic
support, and I am sure othere IDE`s also supports junit).

3. you can create an build file that will invoke the junit task for the
automated testing.

Chun Ji wrote:

> We have a project going on, which involves 20 developers, 2000+ java files, 3,000+ junit test cases and
ORACLE database. Every morning, there will be a cron job running ant to do the build and run these junit test
cases. It also sends the results to everyone.   
>
> Our manager is looking for 0% failure for the junit tests, which is very difficult to reach. There is quite a
few time that Person A's changes causes the failure of Person B's Junit test cases!  
>
> So we are just thinking if we could create an "object" to a web server to invoke these build and testing
targets in ant. Whoever commits some new changes, he may just need to "push a button" at the front-end, to
make sure the changes DO NOT break anything 
>
> comments, ideas, examples ? 
>
>
>
> Charlie, 
>   
>
>
>
(Continue reading)


Gmane