Re: retrieve sync not deleting even when it says it is

2011-03-10 Thread Derek E
Okay, following up on this.  I've reviewed the documentation found here:
http://ant.apache.org/ivy/ivyde/history/latest-milestone/index.html

<http://ant.apache.org/ivy/ivyde/history/latest-milestone/index.html>And it
looks like I have everything setup as recommended.  So what doesn't make
sense to me is why is there a lock on the jars after I remove them from
Ivy.xml?  My thinking is that once I remove that dependency, then IvyDE will
do a resolve and remove that file from the classpath, thus releasing any
locks.  Then when I call the ivy:retrieve ant task with sync="true", it
should be free to delete that file.  Am I missing something?  How do most
people have this setup?


On Wed, Mar 9, 2011 at 5:49 PM, Derek E  wrote:

> Good call.  I have to shut down Eclipse to delete the files.  I have IvyDE
> installed, but followed the setup described here to handle the classpath.
>
>
> http://www.beilers.com/2010/07/eclipse-3-6-helios-wtp-ivy-and-deployment-assembly-working-reliably-at-last/
>
>
> On Wed, Mar 9, 2011 at 1:50 PM, Maarten Coene wrote:
>
>> Maybe they are locked by another process?
>> Can you delete them  with Windows Explorer?
>>
>> Maarten
>>
>>
>>
>>
>> - Original Message 
>> From: Derek E 
>> To: ivy-u...@ant.apache.org
>> Sent: Wed, March 9, 2011 7:40:31 PM
>> Subject: retrieve sync not deleting even when it says it is
>>
>> I have the following build target:
>>
>> ***   build.xml   ***
>>
>> > sync="true" />
>>
>>
>> Which, when run with the -debug flag, returns the following in the
>> console:
>> *** Debug Logs   ***
>> [ivy:retrieve] syncing...
>> [ivy:retrieve] deleting
>>
>> C:\dev\Workspace\COR-1568\WebContent\WEB-INF\lib\spring-web-2.5.6.SEC01.jar
>> [ivy:retrieve] deleting
>> C:\dev\Workspace\COR-1568\WebContent\WEB-INF\lib\spring-support-1.2.9.jar
>> [ivy:retrieve] deleting
>> C:\dev\Workspace\COR-1568\WebContent\WEB-INF\lib\spring-dao-1.2.9.jar
>> [ivy:retrieve] deleting
>> C:\dev\Workspace\COR-1568\WebContent\WEB-INF\lib\activation-1.1.jar
>> [ivy:retrieve] deleting
>> C:\dev\Workspace\COR-1568\WebContent\WEB-INF\lib\spring-aop-1.2.9.jar
>> [ivy:retrieve] 122 artifacts copied (63841kB/458ms)
>> [ivy:retrieve] retrieve done (458ms)
>> Setting project property: ivy.nb.targets.copied -> 122
>> Setting project property: ivy.targets.copied -> true
>> BUILD SUCCESSFUL
>> Total time: 4 seconds
>>
>> But when I check C:\dev\Workspace\COR-1568\WebContent\WEB-INF\lib\, those
>> jar files that were indicated as being deleted are still in there.  What
>> can
>> I do to find out why these files aren't getting deleted?
>>
>> Thanks
>>
>>
>>
>>
>>
>


Configure an ANT project in Java

2009-05-07 Thread Cole, Derek E
Hello all. I am trying to configure an Ant project from a Java class
using the API. I have set up my Project like so

 

antproject.init();

  ProjectHelper helper =
ProjectHelper.getProjectHelper();

  antproject.addReference("ant.projectHelper", helper);

  helper.parse(antproject, buildFile);

 
antproject.executeTarget(antproject.getDefaultTarget());

 

The problem is, I don't think all of the properties are loading
properly. Some of my build files that use a property file seem to not be
getting the values from the build.properties file they are using. I also
seem to be losing the value of JAVA_HOME in the build files. I am not
sure why this is happening. Whenever I get to a javac task, the build
fails.

 

I have not tried to set the property "java.home" because I didn't think
I had to.  I basically want to do as minimal configuring of the project
as possible, as if I was just running ant from the command line, because
all of my buildfiles are already complete..just trying to automate the
execution of previously existing files.

 

Thanks in advance,

 

Derek



Configure an ANT project in Java

2009-05-07 Thread Cole, Derek E
Hello all. I am trying to configure an Ant project from a Java class
using the API. I have set up my Project like so

 

antproject.init();

  ProjectHelper helper =
ProjectHelper.getProjectHelper();

  antproject.addReference("ant.projectHelper", helper);

  helper.parse(antproject, buildFile);

 
antproject.executeTarget(antproject.getDefaultTarget());

 

The problem is, I don't think all of the properties are loading
properly. Some of my build files that use a property file seem to not be
getting the values from the build.properties file they are using. I also
seem to be losing the value of JAVA_HOME in the build files. I am not
sure why this is happening. Whenever I get to a javac task, the build
fails.

 

I have not tried to set the property "java.home" because I didn't think
I had to.  I basically want to do as minimal configuring of the project
as possible, as if I was just running ant from the command line, because
all of my buildfiles are already complete..just trying to automate the
execution of previously existing files.

 

Thanks in advance,

 

Derek



Running ant programmatically using API

2009-05-11 Thread Cole, Derek E
Hi All. If I am creating an ANT project programmatically with the Java
API, and I want my invoked instance of Ant to have the same classpath as
my system, how can I do this? 

 

I have tried a few different things, but none seem to work. If there are
any javac tasks in my build.xml files, it seems like it cannot find the
JDK (and in fact, seems to be pointing to some JRE install..even though
JAVA_HOME is set correctly on the workstation).

 

Thanks

 

Derek

 



RE: API for setting a property reference?

2009-05-12 Thread Cole, Derek E
Look at the property class in the Ant API. There is a setRefId method
that might do what you're talking about.

-Original Message-
From: John Francis [mailto:jfran...@his.co.uk] 
Sent: Tuesday, May 12, 2009 11:21 AM
To: user@ant.apache.org
Subject: API for setting a property reference?

 
Hi,
 
Is there a way to programmatically (i.e. using the API) set the id
of a
property in Ant, so I can reference it via refid later on?
 
( Similar to "Java Development with Ant" first edition pp 80-81  but in
code
)
 

 
 


 
Thanks


--

This message is private and confidential. If you have received this
message
in error, please notify postmas...@his.co.uk and remove it from your
system.

Please carry out your own virus check before opening attachments.

HISL Limited is a limited company registered in England and Wales.

Registered Number: 3202995. VAT number: 729-6256-05.

Registered Office: Chestnut Farm, Jill Lane, Sambourne, Redditch B96 6ES



--

 

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Problem with Ant and MailLogger

2009-05-12 Thread Cole, Derek E
I am only slightly familiar with this, but don't you have to have a
MailLogger.properties file defined and passed to the mail logger with
-DMailLogger.properties.file=

-Original Message-
From: Richard, Troy [mailto:troy.rich...@blackhillscorp.com] 
Sent: Tuesday, May 12, 2009 4:09 PM
To: user@ant.apache.org
Subject: Problem with Ant and MailLogger

I'm getting the following error message:

MailLogger failed to send e-mail!
java.io.IOException: Unexpected reply to command: HELO L00113: 451 4.7.0
Timeout
 waiting for client input
at org.apache.tools.mail.MailMessage.send(MailMessage.java:445)
at
org.apache.tools.mail.MailMessage.sendHelo(MailMessage.java:411)
at
org.apache.tools.mail.MailMessage.(MailMessage.java:176)
at
org.apache.tools.ant.listener.MailLogger.sendMail(MailLogger.java:273
)
at
org.apache.tools.ant.listener.MailLogger.buildFinished(MailLogger.jav
a:141)
at
org.apache.tools.ant.Project.fireBuildFinished(Project.java:2037)
at org.apache.tools.ant.Main.runBuild(Main.java:778)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

I cannot seem to figure out where my problem is.  I'm trying to build a
java project using the Websphere java environment.  Here is the command
I'm trying to execute.

call %ANT_HOME%/bin/ant.bat -buildfile SampleWebProject.xml -logger
org.apache.tools.ant.listener.MailLogger -DrunFromMain=true -verbose
buildTest

Where %ANT_HOME% = c:\apache-ant-1.7.1

Any help would be appreciated.

Thanks
Troy

Troy B. Richard
Applications Manager for Exploration & Production
Black Hills Corporation
o: 303.566.3360
c: 303.518.6483
e:
troy.rich...@blackhillscorp.com



This electronic message transmission contains information from Black
Hills Corporation, its affiliate or subsidiary, which may be
confidential or privileged. The information is intended to be for the
use of the individual or entity named above. If you are not the intended
recipient, be aware the disclosure, copying, distribution or use of the
contents of this information is prohibited. If you received this
electronic transmission in error, please reply to sender immediately;
then delete this message without copying it or further reading.

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Java in JDK but ANT can't find it!

2009-05-14 Thread Cole, Derek E
So, I searched the internet for days trying to find out how to do this,
and never could find a straight answer. If you or anyone else has a
better way to do this, let me know, but I found two ways to make this
work.

The first way is to use the AntClassLoader API. I set up a Boolean true,
a null path, and used

AntClassLoader ACL = new AntClassLoader(antproject, path, true);

Which says to use the system classloader, and anything additional in the
path (which I didn't put anything it). This seems to have worked.

The next idea is to set the external compiler property to true.

Hope this helps

Derek

-Original Message-
From: David Nemer [mailto:davidne...@gmail.com] 
Sent: Thursday, May 14, 2009 8:15 AM
To: Ant Users List
Subject: Java in JDK but ANT can't find it!

Hello Everyone,

I am running ANT programmatically in JAVA. So, my task is to build the
BUILD.XML.
I'm able to do so, but it throws an exception saying:

/scratch2/nemer/test/xfire/build.xml:5: The following error occurred
while
executing this line:
/scratch2/nemer/test/xfire/build-common.xml:81: Unable to find a javac
compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/opt/jdk1.6.0_06/jre"

But in the end it says: BUILD SUCCESSFUL (but it still throws that
exception).

I already set all of my environment variables to  /opt/jdk1.6.0_06/
(JAVA_HOME and also in PATH), which is a JDK! And even on the error
message
it says that the java is set to /opt/jdk1.6.0_06/jre (which is a JDK, I
don't know where it gets the jre from).

So, does any one know how can I solve this problem? Is there a
configuration
file in ANT that we need to set up! I'm stuck there!!

I'm running the ant 1.7.1.

Cheers,
--
David Nemer
Sent from Saarbrucken, SL, Germany

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Java in JDK but ANT can't find it!

2009-05-14 Thread Cole, Derek E
When I had this problem, I KNOW that JAVA_HOME was set correctly. I
still ran into the problem. The OP here also said JAVA_HOME was set
correctly. There is some missing step here that prevents the ant Project
instance from knowing which Java to use.

-Original Message-
From: Ashley Williams [mailto:ashpub...@mac.com] 
Sent: Thursday, May 14, 2009 9:56 AM
To: Ant Users List
Subject: Re: Java in JDK but ANT can't find it!

It looks like you are pointing to the jre not the jdk.
Try repointing the JAVA_HOME environment variable to the jdk directory  
instead,


On 14 May 2009, at 13:15, David Nemer wrote:

> Hello Everyone,
>
> I am running ANT programmatically in JAVA. So, my task is to build the
> BUILD.XML.
> I'm able to do so, but it throws an exception saying:
>
> /scratch2/nemer/test/xfire/build.xml:5: The following error occurred  
> while
> executing this line:
> /scratch2/nemer/test/xfire/build-common.xml:81: Unable to find a javac
> compiler;
> com.sun.tools.javac.Main is not on the classpath.
> Perhaps JAVA_HOME does not point to the JDK.
> It is currently set to "/opt/jdk1.6.0_06/jre"
>
> But in the end it says: BUILD SUCCESSFUL (but it still throws that
> exception).
>
> I already set all of my environment variables to  /opt/jdk1.6.0_06/
> (JAVA_HOME and also in PATH), which is a JDK! And even on the error  
> message
> it says that the java is set to /opt/jdk1.6.0_06/jre (which is a  
> JDK, I
> don't know where it gets the jre from).
>
> So, does any one know how can I solve this problem? Is there a  
> configuration
> file in ANT that we need to set up! I'm stuck there!!
>
> I'm running the ant 1.7.1.
>
> Cheers,
> --
> David Nemer
> Sent from Saarbrucken, SL, Germany


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Java in JDK but ANT can't find it!

2009-05-14 Thread Cole, Derek E
>> I already set all of my environment variables to  /opt/jdk1.6.0_06/
>> (JAVA_HOME and also in PATH), which is a JDK!


The error message from ant appends "jre" to the end of whatever you have
JAVA_HOME set to, so it returns something like this:

>> com.sun.tools.javac.Main is not on the classpath.
>> Perhaps JAVA_HOME does not point to the JDK.
>> It is currently set to "/opt/jdk1.6.0_06/jre"

-Original Message-
From: Ashley Williams [mailto:ashpub...@mac.com] 
Sent: Thursday, May 14, 2009 10:43 AM
To: Ant Users List
Subject: Re: Java in JDK but ANT can't find it!

In your description you say that  JAVA_HOME=/opt/jdk1.6.0_06/jre

Seriously, try JAVA_HOME= /opt/jdk1.6.0_06 instead



On 14 May 2009, at 15:28, Cole, Derek E wrote:

> When I had this problem, I KNOW that JAVA_HOME was set correctly. I
> still ran into the problem. The OP here also said JAVA_HOME was set
> correctly. There is some missing step here that prevents the ant  
> Project
> instance from knowing which Java to use.
>
> -Original Message-
> From: Ashley Williams [mailto:ashpub...@mac.com]
> Sent: Thursday, May 14, 2009 9:56 AM
> To: Ant Users List
> Subject: Re: Java in JDK but ANT can't find it!
>
> It looks like you are pointing to the jre not the jdk.
> Try repointing the JAVA_HOME environment variable to the jdk directory
> instead,
>
>
> On 14 May 2009, at 13:15, David Nemer wrote:
>
>> Hello Everyone,
>>
>> I am running ANT programmatically in JAVA. So, my task is to build  
>> the
>> BUILD.XML.
>> I'm able to do so, but it throws an exception saying:
>>
>> /scratch2/nemer/test/xfire/build.xml:5: The following error occurred
>> while
>> executing this line:
>> /scratch2/nemer/test/xfire/build-common.xml:81: Unable to find a  
>> javac
>> compiler;
>> com.sun.tools.javac.Main is not on the classpath.
>> Perhaps JAVA_HOME does not point to the JDK.
>> It is currently set to "/opt/jdk1.6.0_06/jre"
>>
>> But in the end it says: BUILD SUCCESSFUL (but it still throws that
>> exception).
>>
>> I already set all of my environment variables to  /opt/jdk1.6.0_06/
>> (JAVA_HOME and also in PATH), which is a JDK! And even on the error
>> message
>> it says that the java is set to /opt/jdk1.6.0_06/jre (which is a
>> JDK, I
>> don't know where it gets the jre from).
>>
>> So, does any one know how can I solve this problem? Is there a
>> configuration
>> file in ANT that we need to set up! I'm stuck there!!
>>
>> I'm running the ant 1.7.1.
>>
>> Cheers,
>> --
>> David Nemer
>> Sent from Saarbrucken, SL, Germany
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Java in JDK but ANT can't find it!

2009-05-14 Thread Cole, Derek E
Ashley,  can you post a snippet of how you set up the project you launch
programmatically from java? 

What does your build file that you are running from java contain in it?

-Original Message-
From: Ashley Williams [mailto:ashpub...@mac.com] 
Sent: Thursday, May 14, 2009 10:54 AM
To: Ant Users List
Subject: Re: Java in JDK but ANT can't find it!

Check your PATH to make sure you are launching your application from  
the jdk and not the jre.

I launch programatically and I don't get these errors with the same  
version of ant so it does
sound as if the problem lies outside of ant.

On 14 May 2009, at 15:46, David Nemer wrote:

> This is what I'm trying to tell you! My JAVA_HOME it is set as
> /opt/jdk1.6.0_06 I've triple checked it on my bash file! I also  
> check with
> echo $JAVA_HOME and which java, they all tell the right path, but  
> not ANT!
> This is why I don't understand where does ant get this /jre !!
> --
> David Nemer
> Sent from Kaiserslautern, RP, Germany
>
> On Thu, May 14, 2009 at 4:42 PM, Ashley Williams   
> wrote:
>
>> In your description you say that  JAVA_HOME=/opt/jdk1.6.0_06/jre
>>
>> Seriously, try JAVA_HOME= /opt/jdk1.6.0_06 instead
>>
>>
>>
>>
>> On 14 May 2009, at 15:28, Cole, Derek E wrote:
>>
>> When I had this problem, I KNOW that JAVA_HOME was set correctly. I
>>> still ran into the problem. The OP here also said JAVA_HOME was set
>>> correctly. There is some missing step here that prevents the ant  
>>> Project
>>> instance from knowing which Java to use.
>>>
>>> -Original Message-
>>> From: Ashley Williams [mailto:ashpub...@mac.com]
>>> Sent: Thursday, May 14, 2009 9:56 AM
>>> To: Ant Users List
>>> Subject: Re: Java in JDK but ANT can't find it!
>>>
>>> It looks like you are pointing to the jre not the jdk.
>>> Try repointing the JAVA_HOME environment variable to the jdk  
>>> directory
>>> instead,
>>>
>>>
>>> On 14 May 2009, at 13:15, David Nemer wrote:
>>>
>>> Hello Everyone,
>>>>
>>>> I am running ANT programmatically in JAVA. So, my task is to  
>>>> build the
>>>> BUILD.XML.
>>>> I'm able to do so, but it throws an exception saying:
>>>>
>>>> /scratch2/nemer/test/xfire/build.xml:5: The following error  
>>>> occurred
>>>> while
>>>> executing this line:
>>>> /scratch2/nemer/test/xfire/build-common.xml:81: Unable to find a  
>>>> javac
>>>> compiler;
>>>> com.sun.tools.javac.Main is not on the classpath.
>>>> Perhaps JAVA_HOME does not point to the JDK.
>>>> It is currently set to "/opt/jdk1.6.0_06/jre"
>>>>
>>>> But in the end it says: BUILD SUCCESSFUL (but it still throws that
>>>> exception).
>>>>
>>>> I already set all of my environment variables to  /opt/jdk1.6.0_06/
>>>> (JAVA_HOME and also in PATH), which is a JDK! And even on the error
>>>> message
>>>> it says that the java is set to /opt/jdk1.6.0_06/jre (which is a
>>>> JDK, I
>>>> don't know where it gets the jre from).
>>>>
>>>> So, does any one know how can I solve this problem? Is there a
>>>> configuration
>>>> file in ANT that we need to set up! I'm stuck there!!
>>>>
>>>> I'm running the ant 1.7.1.
>>>>
>>>> Cheers,
>>>> --
>>>> David Nemer
>>>> Sent from Saarbrucken, SL, Germany
>>>>
>>>
>>>
>>>
-
>>> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
>>> For additional commands, e-mail: user-h...@ant.apache.org
>>>
>>>
>>>
-
>>> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
>>> For additional commands, e-mail: user-h...@ant.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
>> For additional commands, e-mail: user-h...@ant.apache.org
>>
>>


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



Demux output when running ant programmatically

2009-05-14 Thread Cole, Derek E
Hello All!

 

I am trying to capture ALL of the output that comes when I am running my
build using the Ant API. I have associated a DefaultLogger with the ant
project, but that seems to miss a lot of the output from javac errors
and warnings. Any ideas how I can do this? I have tried to look into
using DemuxOutputStream but I must not be doing it right, because it is
still not being written into my log file.

 

This is what I had used before:

 

System.setOut(new PrintStream(new DemuxOutputStream(antproject,
false)));

System.setErr(new PrintStream(new DemuxOutputStream(antproject, true)));

 

 

This does at least keep it from all going to the file, but my
understanding is that DemuxOutputStream should redirect the output to
the antproject, which would then log it with my default logger..but its
not working like that. Any ideas?

 

 

 



RE: Java in JDK but ANT can't find it!

2009-05-18 Thread Cole, Derek E
Here is how I have set this up to work:

Project Antproject = new Project();

boolean t = true;
Path path = null;
AntClassLoader ACL = new AntClassLoader(Antproject, path, t); 
//this causes ant to use the system path classpath since I passed in a
"true" value. To append //items, use something besides path = null.
Antproject.setUserProperty("ant.file", someFile.getAbsolutePath());
Antproject.fireBuildStarted();
Antproject.init();
ProjectHelper helper = ProjectHelper.getProjectHelper();
Helper.parse(antproject, someFile);
Antproject.executeTarget("package");
Antproject.fireBuildFinished(null);

This is not the complete source, but I did have to add some methods,
etc. You will probably want to add some stuff to the classpath to
include all the jar files in ant/lib directory. I also added the
java_home/lib/tools.jar to the classpath on my system.

I am going to start a blog with some of this info, because I also had a
heck  of a time capturing the javac tasks output when adding a logger to
the build, as well as some other issues. 


I was running this java program using a  task in a separate ant
file, btw. I also intend to fire a version from a perl script.


-Original Message-
From: Ashley Williams [mailto:ashpub...@mac.com] 
Sent: Sunday, May 17, 2009 9:00 AM
To: Ant Users List
Subject: Re: Java in JDK but ANT can't find it!

Hi David,

I never meant that you should modify the ant code.
Try launching your app with the fully qualified
path to the jdk java eg:

 > /path/to/jdk/bin/java MyTestApp

So in other words don't rely on your PATH environment variable. It  
could be
also that the bootclasspath has been overridden so that tools.jar has  
been
taken out. Are you on the mac, in which case you don't have tools.jar?

Try the same experiment by stealing the very last line in the ant  
launcher
script and hardcoding the values that you know you need to use. On my
installation of ant I would start with this line:

ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath  
\"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir= 
\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher  
$ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"

I say this again, the idea behind this is that you need to assume that  
your
environment variables and shell scripts can't be trusted and therefore
bipass them.

I mentioned this before, but remove any compiler fork option so that  
the task
is being executed in the same vm. Then if it behaves differently in a  
forked
vm, you know that the vm environment isn't being inherited properly and
that's where you need to look.

You could try removing all java installations from your machine and then
reinstalling just the jdk that you need. I know for example that windows
gets up to tricks such as adding a java.exe in the windows system  
directory
that is always first in the PATH that you have to remember to manually
delete.

Sorry you are having all these frustrating problems, good luck.


On 16 May 2009, at 20:25, David Nemer wrote:

> Just a remark, when I run the application and /opt/jdk1.6.0_06/lib/ 
> tools.jar
> to the classpath. It gives me a different error message:  "Compile  
> failed;
> see the compiler error output for details." there is no error msg  
> and it
> still says BUILD SUCCESSFUL
>
>
> --
> David Nemer
> Sent from Kaiserslautern, RP, Germany
>
> On Sat, May 16, 2009 at 9:11 PM, David Nemer   
> wrote:
>
>> Hello Michael,
>>
>> here is my code on how I'm invoking Ant:
>>
>>Project p = new Project();
>>p.setUserProperty("ant.file",  
>> buildFile.getAbsolutePath());
>>DefaultLogger consoleLogger = new DefaultLogger();
>>consoleLogger.setErrorPrintStream(System.err);
>>consoleLogger.setOutputPrintStream(System.out);
>>consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
>>p.addBuildListener(consoleLogger);
>>p.fireBuildStarted();
>>p.init();
>>ProjectHelper helper = ProjectHelper.getProjectHelper();
>>p.addReference("ant.projectHelper", helper);
>>helper.parse(p, buildFile);
>>p.executeTarget(p.getDefaultTarget());
>>
>> Michael, I read somewhere that when you invoke ANT in java, it runs  
>> in the
>> same JVM, and forking the ANT process might solve it. Do you have  
>> any idea
>> how would I code this?? Make Ant ran in another JVM?
>>
>>
>> --
>> David Nemer
>> Sent from Kaiserslautern, RP, Germany
>>
>> On Sat, May 16, 2009 at 9:03 PM, Michael Ludwig   
>> wrote:
>>
>>> David Nemer schrieb am 16.05.2009 um 20:51:31 (+0200):
>>>
 ne...@kubrick:~$ java -jar
>>> /home/nemer/apache-ant-1.7.1/lib/ant-launcher.jar
 -version
 Apache Ant version 1.7.1 compiled on June 27 2008

 ne...@kubrick:~$ /opt/jdk1.6.0_06/bin/java -jar
 /home/nemer/apache-ant-1.7.1/lib/ant-launcher.jar -version
 Apache Ant version 1.7.1 compiled on June 27 2008

 so just running JAVA wo

RE: Sending small mail when build is finished

2009-05-18 Thread Cole, Derek E
Create your own version of  maillogger , put it on your classpath, and invoke 
it the same way you would the default maillogger.

-Original Message-
From: Knuplesch, Juergen [mailto:juergen.knuple...@icongmbh.de] 
Sent: Monday, May 18, 2009 4:02 AM
To: user@ant.apache.org
Subject: Sending small mail when build is finished

Hello,

My challenge is:
I dont want to use the maillogger anymore, because our logs have become very 
large.
So I started to use -logfile and store it with my Buildresults.

But on the other hand: I want to send a small mail, that tells me whether the 
build was ok or not.
How can I do this?

Greetings

Jürgen

-- 
Jürgen Knuplesch   

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Java in JDK but ANT can't find it!

2009-05-18 Thread Cole, Derek E
ProjectHelper.getProjectHelper();
> p.addReference("ant.projectHelper", helper);
> helper.parse(p, buildFile);
>
> p.executeTarget(p.getDefaultTarget());
> p.fireBuildFinished(null);
>
> db.insertBuildData(Integer.toString(revisionNumber),
"YES",
> "");
> } catch (BuildException e) {
>
> if (e.toString().contains("Unable to find a javac
> compiler;")){
>
>
db.insertBuildData(Integer.toString(revisionNumber),
> "YES", "Unable to find a javac compiler");
>
> } else{
>
db.insertBuildData(Integer.toString(revisionNumber),
> "NO", e.toString());
> }
> }
>
> --
> David Nemer
> Sent from Kaiserslautern, RP, Germany
>
> On Mon, May 18, 2009 at 3:33 PM, Cole, Derek E
wrote:
>
>> Here is how I have set this up to work:
>>
>> Project Antproject = new Project();
>>
>> boolean t = true;
>> Path path = null;
>> AntClassLoader ACL = new AntClassLoader(Antproject, path, t);
>> //this causes ant to use the system path classpath since I passed in
a
>> "true" value. To append //items, use something besides path = null.
>> Antproject.setUserProperty("ant.file", someFile.getAbsolutePath());
>> Antproject.fireBuildStarted();
>> Antproject.init();
>> ProjectHelper helper = ProjectHelper.getProjectHelper();
>> Helper.parse(antproject, someFile);
>> Antproject.executeTarget("package");
>> Antproject.fireBuildFinished(null);
>>
>> This is not the complete source, but I did have to add some methods,
>> etc. You will probably want to add some stuff to the classpath to
>> include all the jar files in ant/lib directory. I also added the
>> java_home/lib/tools.jar to the classpath on my system.
>>
>> I am going to start a blog with some of this info, because I also had
a
>> heck  of a time capturing the javac tasks output when adding a logger
to
>> the build, as well as some other issues.
>>
>>
>> I was running this java program using a  task in a separate ant
>> file, btw. I also intend to fire a version from a perl script.
>>
>>
>> -Original Message-
>> From: Ashley Williams [mailto:ashpub...@mac.com]
>> Sent: Sunday, May 17, 2009 9:00 AM
>> To: Ant Users List
>> Subject: Re: Java in JDK but ANT can't find it!
>>
>> Hi David,
>>
>> I never meant that you should modify the ant code.
>> Try launching your app with the fully qualified
>> path to the jdk java eg:
>>
>>  > /path/to/jdk/bin/java MyTestApp
>>
>> So in other words don't rely on your PATH environment variable. It
>> could be
>> also that the bootclasspath has been overridden so that tools.jar has
>> been
>> taken out. Are you on the mac, in which case you don't have
tools.jar?
>>
>> Try the same experiment by stealing the very last line in the ant
>> launcher
>> script and hardcoding the values that you know you need to use. On my
>> installation of ant I would start with this line:
>>
>> ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath
>> \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=
>> \"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher
>> $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args"
>>
>> I say this again, the idea behind this is that you need to assume
that
>> your
>> environment variables and shell scripts can't be trusted and
therefore
>> bipass them.
>>
>> I mentioned this before, but remove any compiler fork option so that
>> the task
>> is being executed in the same vm. Then if it behaves differently in a
>> forked
>> vm, you know that the vm environment isn't being inherited properly
and
>> that's where you need to look.
>>
>> You could try removing all java installations from your machine and
then
>> reinstalling just the jdk that you need. I know for example that
windows
>> gets up to tricks such as adding a java.exe in the windows system
>> directory
>> that is always first in the PATH that you have to remember to
manually
>> delete.
>>
>> Sorry you are having all these frustrating problems, good luck.
>>
>>
>> On 16 May 2009, at 20:25, David Nemer wrote:
>>
>> > Just a remark, when I run the application and /opt/jdk1.6.0_06/lib/
>> > tools.jar
>> > to the classpath. It gives m

include path in

2009-05-19 Thread Cole, Derek E
Hello all,

I am interested in passing in a  reference to the  tags
of my  call. How can this be done? 











CP:${toString:apache.beehive.classpath}

CP: outputs the correct thing, however, when I then try to use that like

   

   

I get this kind of error message in my log:

dropping /tools/build/antstuff/apache.beehive.classpath from path as it
doesn't exist

what am I doing wrong?

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



wlappc runtimeflags

2009-05-21 Thread Cole, Derek E
I am not sure if this is the best place to be asking, but I am trying to
run the  task on some ear files, and I don't want it to use
system TEMP for extracting out stuff into.  It is my understanding it
uses whatever java.io.tmpdir is set to, and so I was trying to invoke
some runtime flags within the task to set that, such as

 

runtimeflags="-J-djava.io.tmpdir=/tmp/hello"  

 

And I get results back like

 

[wlappc] J-djava.io.tmpdir="/tmp/hello" isn't a valid flag option.

 

Any ideas what I need to do to change that  value?



RE: Taskdef classloader issue

2009-05-29 Thread Cole, Derek E
Martin, I didn't have time to fully read over this, but this is the most 
comprehensive example I've seen in a while for setting up a project. I had a 
heck of a time trying to figure out how to set up a classpath in an ant project 
I was building a while back. Thanks for posting!

-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Friday, May 29, 2009 11:27 AM
To: Ant Users List
Subject: RE: Taskdef classloader issue


here is the testcase:

package org.apache.tools.ant;
public class AntClassLoaderTest extends BuildFileTest {

private Project p;

public AntClassLoaderTest(String name) {
super(name);
}

public void setUp() {
p = new Project();
p.init();
configureProject("src/etc/testcases/core/antclassloader.xml");
getProject().executeTarget("setup");
}

public void tearDown() {
getProject().executeTarget("cleanup");
}
//test inspired by bug report 37085
public void testJarWithManifestInDirWithSpace() {
String mainjarstring = getProject().getProperty("main.jar");
String extjarstring = getProject().getProperty("ext.jar");
Path myPath = new Path(getProject());
myPath.setLocation(new File(mainjarstring));
getProject().setUserProperty("build.sysclasspath","ignore");
AntClassLoader myLoader = getProject().createClassLoader(myPath);
String path = myLoader.getClasspath();
assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
}
public void testJarWithManifestInNonAsciiDir() {
String mainjarstring = getProject().getProperty("main.jar.nonascii");
String extjarstring = getProject().getProperty("ext.jar.nonascii");
Path myPath = new Path(getProject());
myPath.setLocation(new File(mainjarstring));
getProject().setUserProperty("build.sysclasspath","ignore");
AntClassLoader myLoader = getProject().createClassLoader(myPath);
String path = myLoader.getClasspath();
assertEquals(mainjarstring + File.pathSeparator + extjarstring, path);
}
public void testCleanup() throws BuildException {
Path path = new Path(p, ".");
AntClassLoader loader = p.createClassLoader(path);
try {
// we don't expect to find this
loader.findClass("fubar");
fail("Did not expect to find fubar class");
} catch (ClassNotFoundException e) {
// ignore expected
}

loader.cleanup();
try {
// we don't expect to find this
loader.findClass("fubar");
fail("Did not expect to find fubar class");
} catch (ClassNotFoundException e) {
// ignore expected
} catch (NullPointerException e) {
fail("loader should not fail even if cleaned up");
}

// tell the build it is finished
p.fireBuildFinished(null);
try {
// we don't expect to find this
loader.findClass("fubar");
fail("Did not expect to find fubar class");
} catch (ClassNotFoundException e) {
// ignore expected
} catch (NullPointerException e) {
fail("loader should not fail even if project finished");
}
}
}

getProject().setUserProperty("build.sysclasspath","ignore");

AntClassLoader myLoader = getProject().createClassLoader(myPath);
build.sysclasspath
The value of the build.sysclasspath property
control how the system classpath, ie. the classpath in effect when
Ant is run, affects the behaviour of classpaths in Ant.
The default behavior varies from Ant to Ant task.


The values and their meanings are:



only
Only the system classpath is used and classpaths specified in build files,
etc are ignored. This situation could be considered as the person running
the build file knows more about the environment than the person writing the
build file




ignore

The system classpath is ignored. This situation is the reverse of the
above. The person running the build trusts the build file writer to get the
build file right




last

The classpath is concatenated to any specified classpaths at the end. This
is a compromise, where the build file writer has priority.




first

Any specified classpaths are concatenated to the system classpath. This is
the other form of compromise where the build runner has priority.
setting build.sysclasspath to ignore allows your build file writer to have 
priority over previous classpaths e.g.





Viel Gluck!
Martin 
__ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungsw

Running multiple ant projects from threaded java project

2009-06-02 Thread Cole, Derek E
Hi All. I have a java project that is creating a thread for the purpose
of creating and running an ant project in each thread so I can run
multiple ant builds at the same time. The java program is using the ant
API to set up the project, add a  listener, etc.  The problem is, if I
add a logger to each project, and pass each one of those a file stream,
I am losing information. It would seem that all of the standard output
is logged correctly, but whenever there is an error (like messages
coming from javac), they are not making it into the log file. Has anyone
tried to do this before? I was going to try to look at something like
Hudson to see how it does it, but I haven't gotten that far yet, thought
I'd see if anyone here has tried to run multiple ant projects from a
java file before.

 

Derek



RE: Replacing build.xml with Build.java - Doing Ant builds directly from Java

2009-06-11 Thread Cole, Derek E
You are correct that there is very little documentation on the subject, other 
than a few small, simple examples on the net.  It seemed like one of the 
responders in that link you posted was implying that he spoofed the tasks he 
needed to use? That seems like quite a bit more work than would be necessary. 
When I have used ant from java, it was primarily to control dependencies, but I 
still had underlying build.xml files that individual targets were called from, 
using the java program to control when, handle errors, etc.

Derek

-Original Message-
From: Dean Schulze [mailto:dean_w_schu...@yahoo.com] 
Sent: Thursday, June 11, 2009 11:28 AM
To: user@ant.apache.org
Subject: Replacing build.xml with Build.java - Doing Ant builds directly from 
Java


The Ant documentation has a section titled "Using Ant Tasks Outside
of Ant" which gives a teaser for how to use the Ant libraries from Java
code.  In theory it seems simple enough to replace build.xml with
Build.java. The Ant documentation hints at some undocumented
dependencies that I'll have to discover (undocumented from the point of
view of using Ant from within Java).
Using Java instead of xml to do an Ant build seems so obvious I wonder why 
there hasn't been a parallel track over the years for Build.java as well as 
build.xml.
I asked this same question over at stackoverflow.com:
http://stackoverflow.com/questions/972574/replacing-build-xml-with-build-java-using-java-and-the-ant-libraries-as-a-build
The answers indicate that it isn't difficult to do, but that it is necessary to 
"spoof" the project and target objects.
While it all looks encouraging I haven't seen any actual examples of how to 
deal with the undocumented issues mentioned.  Has anyone documented how to do 
Ant builds from Java?
Thanks.
Dean




  

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



property inheritance

2009-06-29 Thread Cole, Derek E
Hi all.

 

If I have a build script that makes an  call to another build
script, for a specific target in that build script, are the imports that
the 2nd build script has initialized just the same as if I had called
the 2nd build script's target from command line?

 

I seem to have an issue where when the call to the "package" target of
the 2nd ant from the first ant build script, one of my properties is not
being set correctly (it is set in the file the 2nd build script is
importing)

 

Thanks!


Derek



RE: property inheritance

2009-06-30 Thread Cole, Derek E
I think I may have found something. It seems one of the developers have used 
the  task to pass their parameters in, however, I am guessing that this 
means that any property I over-ride on command line is not available in that 
new "shell" that the apply task creates, is this a correct assumption? 

-Original Message-
From: jan.mate...@rzf.fin-nrw.de [mailto:jan.mate...@rzf.fin-nrw.de] 
Sent: Tuesday, June 30, 2009 2:14 AM
To: user@ant.apache.org
Subject: AW: property inheritance

I set up a little test and all props are set as via CLI.


Jan


build.xml

  
  


second.xml

  
  
  


imported-by-2nd.xml

  


output
--
[echoproperties] #Ant properties
[echoproperties] #Tue Jun 30 08:12:00 CEST 2009
[echoproperties] prop.first=set in the main buildfile
[echoproperties] prop.imported=imported value
[echoproperties] prop.second=set in called buildfile 

>-Ursprüngliche Nachricht-
>Von: Cole, Derek E [mailto:derek.e.c...@lmco.com] 
>Gesendet: Montag, 29. Juni 2009 23:09
>An: Ant Users List
>Betreff: property inheritance
>
>Hi all.
>
> 
>
>If I have a build script that makes an  call to another build
>script, for a specific target in that build script, are the 
>imports that
>the 2nd build script has initialized just the same as if I had called
>the 2nd build script's target from command line?
>
> 
>
>I seem to have an issue where when the call to the "package" target of
>the 2nd ant from the first ant build script, one of my 
>properties is not
>being set correctly (it is set in the file the 2nd build script is
>importing)
>
> 
>
>Thanks!
>
>
>Derek
>
>

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



task hanging

2009-07-22 Thread Cole, Derek E
I am having a problem with some build scripts I have written that have
 tasks to set a property based on whether a particular mount
is available on the build box.  It seems like if the mount is not
available for whatever reason, the build hangs at this point. Has anyone
seen this behavior before? 



Problem with zip task

2009-07-28 Thread Cole, Derek E
Has anyone encountered a problem when running a zip task, the log will
say something like

[zip] Building zip: /path-to/some.war

[zip] adding directory 

 

Then getting an exception that says 

 

Problem creating zip:
/path-to/someotherdir/.nfs0001a121a0003ae (No such file
or directory)

 

 

The way the problem is listed..doesnt that seem like a problem with a
network storage access? /path-to/ is a mount to a NAS



RE: Problem with zip task

2009-07-28 Thread Cole, Derek E
The mounts are persistent, and we are not doing anything like that as
part of the build.


I did find some information on the  .nfs files:


.nfs files are created by a clienthost when one process on the 
clienthost deletes a file while another process on the clienthost is 
still holding the file open. This allows the delete to appear to 
succeed for one process w/o causing the the process to begin getting 
stale nfs file handles. It is a hack, but it is the only way to 
simulate UFS semantics on NFS. The clienthost will normally delete the 
.nfs file once the remaining process holding the file open closes 
it. However, if the clienthost crashes, you get left with a .nfs file 
on the filer. 


Note that if more than one host is involved (e.g, process on host a is 
holding a file open over NFS, while process on host b deletes that 
over NFS), process a will get a stale file handle.


Could something like this be happening as part of a simple zip task?


-Original Message-
From: Scot P. Floess [mailto:sflo...@nc.rr.com] 
Sent: Tuesday, July 28, 2009 1:56 PM
To: Ant Users List
Subject: Re: Problem with zip task


Interesting looks like an nfs issue...  Are you automounting or
anything?

On Tue, 28 Jul 2009, Cole, Derek E wrote:

> Has anyone encountered a problem when running a zip task, the log will
> say something like
>
> [zip] Building zip: /path-to/some.war
>
> [zip] adding directory 
>
>
>
> Then getting an exception that says
>
>
>
> Problem creating zip:
> /path-to/someotherdir/.nfs0001a121a0003ae (No such
file
> or directory)
>
>
>
>
>
> The way the problem is listed..doesnt that seem like a problem with a
> network storage access? /path-to/ is a mount to a NAS
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros  http://sourceforge.net/projects/keros

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Problem with zip task

2009-07-28 Thread Cole, Derek E
I am not sure what is considered relevant...here is the target that is being 
run...

  


 

  


  


In the build log, it says right before the [zip] out put 

[mkdir] Skipping /path-to//archivedir because it already exists

And post-build failure I checked to make sure that staging.dir actually existed 
as well




-Original Message-
From: Greg Roodt [mailto:gro...@gmail.com] 
Sent: Tuesday, July 28, 2009 2:04 PM
To: Ant Users List
Subject: Re: Problem with zip task

H, looks a bit suspicious. Could you please include the relevant parts
of the build.xml?

I know that a few Java File operations dont work very well across file
systems. Renaming has given me problems in the past.



On Tue, Jul 28, 2009 at 6:58 PM, Cole, Derek E wrote:

> The mounts are persistent, and we are not doing anything like that as
> part of the build.
>
>
> I did find some information on the  .nfs files:
>
>
> .nfs files are created by a clienthost when one process on the
> clienthost deletes a file while another process on the clienthost is
> still holding the file open. This allows the delete to appear to
> succeed for one process w/o causing the the process to begin getting
> stale nfs file handles. It is a hack, but it is the only way to
> simulate UFS semantics on NFS. The clienthost will normally delete the
> .nfs file once the remaining process holding the file open closes
> it. However, if the clienthost crashes, you get left with a .nfs file
> on the filer.
>
>
> Note that if more than one host is involved (e.g, process on host a is
> holding a file open over NFS, while process on host b deletes that
> over NFS), process a will get a stale file handle.
>
>
> Could something like this be happening as part of a simple zip task?
>
>
> -Original Message-
> From: Scot P. Floess [mailto:sflo...@nc.rr.com]
> Sent: Tuesday, July 28, 2009 1:56 PM
> To: Ant Users List
> Subject: Re: Problem with zip task
>
>
> Interesting looks like an nfs issue...  Are you automounting or
> anything?
>
> On Tue, 28 Jul 2009, Cole, Derek E wrote:
>
> > Has anyone encountered a problem when running a zip task, the log will
> > say something like
> >
> > [zip] Building zip: /path-to/some.war
> >
> > [zip] adding directory 
> >
> >
> >
> > Then getting an exception that says
> >
> >
> >
> > Problem creating zip:
> > /path-to/someotherdir/.nfs0001a121a0003ae (No such
> file
> > or directory)
> >
> >
> >
> >
> >
> > The way the problem is listed..doesnt that seem like a problem with a
> > network storage access? /path-to/ is a mount to a NAS
> >
> >
>
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
>
> 252-478-8087 (Home)
> 919-890-8117 (Work)
>
> Chief Architect JPlate   http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
>
> Architect Keros  http://sourceforge.net/projects/keros
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Problem with zip task

2009-07-28 Thread Cole, Derek E
Could this be something that is happening because zip, or some task, creates a 
temporary file...then that process dies, leaving the unlinked file out there. 
And for whatever reason, the next time the zip task is run, it is able to see 
this file but...can't get to it?
When I am on the linux box the build is actually running from, I never can see 
any of these .nfs files..but this is the second time in two days this has 
happened to us. Usually we re-run the build, and it is successful the next time.

Derek 

-Original Message-
From: Cole, Derek E 
Sent: Tuesday, July 28, 2009 2:11 PM
To: Ant Users List
Subject: RE: Problem with zip task

I am not sure what is considered relevant...here is the target that is being 
run...

  


 

  


  


In the build log, it says right before the [zip] out put 

[mkdir] Skipping /path-to//archivedir because it already exists

And post-build failure I checked to make sure that staging.dir actually existed 
as well




-Original Message-
From: Greg Roodt [mailto:gro...@gmail.com] 
Sent: Tuesday, July 28, 2009 2:04 PM
To: Ant Users List
Subject: Re: Problem with zip task

H, looks a bit suspicious. Could you please include the relevant parts
of the build.xml?

I know that a few Java File operations dont work very well across file
systems. Renaming has given me problems in the past.



On Tue, Jul 28, 2009 at 6:58 PM, Cole, Derek E wrote:

> The mounts are persistent, and we are not doing anything like that as
> part of the build.
>
>
> I did find some information on the  .nfs files:
>
>
> .nfs files are created by a clienthost when one process on the
> clienthost deletes a file while another process on the clienthost is
> still holding the file open. This allows the delete to appear to
> succeed for one process w/o causing the the process to begin getting
> stale nfs file handles. It is a hack, but it is the only way to
> simulate UFS semantics on NFS. The clienthost will normally delete the
> .nfs file once the remaining process holding the file open closes
> it. However, if the clienthost crashes, you get left with a .nfs file
> on the filer.
>
>
> Note that if more than one host is involved (e.g, process on host a is
> holding a file open over NFS, while process on host b deletes that
> over NFS), process a will get a stale file handle.
>
>
> Could something like this be happening as part of a simple zip task?
>
>
> -Original Message-
> From: Scot P. Floess [mailto:sflo...@nc.rr.com]
> Sent: Tuesday, July 28, 2009 1:56 PM
> To: Ant Users List
> Subject: Re: Problem with zip task
>
>
> Interesting looks like an nfs issue...  Are you automounting or
> anything?
>
> On Tue, 28 Jul 2009, Cole, Derek E wrote:
>
> > Has anyone encountered a problem when running a zip task, the log will
> > say something like
> >
> > [zip] Building zip: /path-to/some.war
> >
> > [zip] adding directory 
> >
> >
> >
> > Then getting an exception that says
> >
> >
> >
> > Problem creating zip:
> > /path-to/someotherdir/.nfs0001a121a0003ae (No such
> file
> > or directory)
> >
> >
> >
> >
> >
> > The way the problem is listed..doesnt that seem like a problem with a
> > network storage access? /path-to/ is a mount to a NAS
> >
> >
>
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
>
> 252-478-8087 (Home)
> 919-890-8117 (Work)
>
> Chief Architect JPlate   http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
>
> Architect Keros  http://sourceforge.net/projects/keros
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
> For additional commands, e-mail: user-h...@ant.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Problem with zip task

2009-07-29 Thread Cole, Derek E
Yes, they are.

-Original Message-
From: Greg Roodt [mailto:gro...@gmail.com] 
Sent: Tuesday, July 28, 2009 5:51 PM
To: Ant Users List
Subject: Re: Problem with zip task

Out of interest, are archive.dir and staging.dir on the same filesystem?



On Tue, Jul 28, 2009 at 7:29 PM, Scot P. Floess  wrote:

>
> I suppose if nothing else maybe exclude all .nfs* files from your
> fileset???
>
>
> On Tue, 28 Jul 2009, Cole, Derek E wrote:
>
>  Could this be something that is happening because zip, or some task,
>> creates a temporary file...then that process dies, leaving the unlinked file
>> out there. And for whatever reason, the next time the zip task is run, it is
>> able to see this file but...can't get to it?
>> When I am on the linux box the build is actually running from, I never can
>> see any of these .nfs files..but this is the second time in two days this
>> has happened to us. Usually we re-run the build, and it is successful the
>> next time.
>>
>> Derek
>>
>> -Original Message-
>> From: Cole, Derek E
>> Sent: Tuesday, July 28, 2009 2:11 PM
>> To: Ant Users List
>> Subject: RE: Problem with zip task
>>
>> I am not sure what is considered relevant...here is the target that is
>> being run...
>>
>>  
>>   
>>   
>>
>>   > whenempty="create">
>> 
>>   
>>
>>  
>>
>>
>> In the build log, it says right before the [zip] out put
>>
>> [mkdir] Skipping /path-to//archivedir because it already exists
>>
>> And post-build failure I checked to make sure that staging.dir actually
>> existed as well
>>
>>
>>
>>
>> -Original Message-
>> From: Greg Roodt [mailto:gro...@gmail.com]
>> Sent: Tuesday, July 28, 2009 2:04 PM
>> To: Ant Users List
>> Subject: Re: Problem with zip task
>>
>> H, looks a bit suspicious. Could you please include the relevant parts
>> of the build.xml?
>>
>> I know that a few Java File operations dont work very well across file
>> systems. Renaming has given me problems in the past.
>>
>>
>>
>> On Tue, Jul 28, 2009 at 6:58 PM, Cole, Derek E > >wrote:
>>
>>  The mounts are persistent, and we are not doing anything like that as
>>> part of the build.
>>>
>>>
>>> I did find some information on the  .nfs files:
>>>
>>>
>>> .nfs files are created by a clienthost when one process on the
>>> clienthost deletes a file while another process on the clienthost is
>>> still holding the file open. This allows the delete to appear to
>>> succeed for one process w/o causing the the process to begin getting
>>> stale nfs file handles. It is a hack, but it is the only way to
>>> simulate UFS semantics on NFS. The clienthost will normally delete the
>>> .nfs file once the remaining process holding the file open closes
>>> it. However, if the clienthost crashes, you get left with a .nfs file
>>> on the filer.
>>>
>>>
>>> Note that if more than one host is involved (e.g, process on host a is
>>> holding a file open over NFS, while process on host b deletes that
>>> over NFS), process a will get a stale file handle.
>>>
>>>
>>> Could something like this be happening as part of a simple zip task?
>>>
>>>
>>> -Original Message-
>>> From: Scot P. Floess [mailto:sflo...@nc.rr.com]
>>> Sent: Tuesday, July 28, 2009 1:56 PM
>>> To: Ant Users List
>>> Subject: Re: Problem with zip task
>>>
>>>
>>> Interesting looks like an nfs issue...  Are you automounting or
>>> anything?
>>>
>>> On Tue, 28 Jul 2009, Cole, Derek E wrote:
>>>
>>>  Has anyone encountered a problem when running a zip task, the log will
>>>> say something like
>>>>
>>>> [zip] Building zip: /path-to/some.war
>>>>
>>>> [zip] adding directory 
>>>>
>>>>
>>>>
>>>> Then getting an exception that says
>>>>
>>>>
>>>>
>>>> Problem creating zip:
>>>> /path-to/someotherdir/.nfs0001a121a0003ae (No such
>>>>
>>> file
>>>
>>>> or directory)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> The way the problem is listed..doesnt that seem like a problem

RE: Problem with zip task

2009-07-29 Thread Cole, Derek E
I don't  think this will be possible really. The filesystem is actually
a clearcase snapshot view on that NAS...it gets a set of default
permissions when the view is created/updated.

-Original Message-
From: Alexey N. Solofnenko [mailto:alexey.solofne...@symyx.com] 
Sent: Tuesday, July 28, 2009 2:02 PM
To: Ant Users List
Subject: Re: Problem with zip task


I recently investigated a problem with NAS with a similar error - the 
folder creation silently failed and then file creation failed with "no 
such file" error. To fix it you will need to recursively set "777" file 
permission and correct owner user and group.

- Alexey.

Cole, Derek E wrote:
> Has anyone encountered a problem when running a zip task, the log will
> say something like
>
> [zip] Building zip: /path-to/some.war
>
> [zip] adding directory 
>
>
>
> Then getting an exception that says
>
>
>
> Problem creating zip:
> /path-to/someotherdir/.nfs0001a121a0003ae (No such
file
> or directory)
>
>
>
>
>
> The way the problem is listed..doesnt that seem like a problem with a
> network storage access? /path-to/ is a mount to a NAS
>
>
>

===
Notice: This e-mail message, together with any attachments, contains
information of Symyx Technologies, Inc. or any of its affiliates or
subsidiaries that may be confidential, proprietary, copyrighted,
privileged and/or protected work product, and is meant solely for
the intended recipient. If you are not the intended recipient, and
have received this message in error, please contact the sender
immediately, permanently delete the original and any copies of this
email and any attachments thereto.

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org



RE: Unable to delete file

2009-08-18 Thread Cole, Derek E
Is the file being stored on an NFS?

-Original Message-
From: Greg Roodt [mailto:gro...@gmail.com]
Sent: Tuesday, August 18, 2009 2:12 PM
To: Ant Users List
Subject: Re: Unable to delete file

Im sure the intentions are good, but these suggestions are not solving the 
problem at hand.

Jeff, I suggest giving us a bit more to work with. Is there any easy way to 
reproduce the behavior you are seeing? Its almost certainly some sort of file 
path problem.



On Tue, Aug 18, 2009 at 7:03 PM, Brian Pontarelli wrote:

>
> Another option is using Savant. Savant provides a nice wrapper around 
> Ant that allows you to create plugins which can be used between 
> projects. The plugins are simply Ant build scripts which are 
> downloaded prior to executing Ant. It also allows you to create 
> targets specific to your project or define all your targets inside your 
> project without using any plugins.
>
> Lastly, Savant manages dependencies well and doesn't do any magic 
> upgrading or version mangling. All dependencies are explicit and it 
> also has a notion of local integration builds that allow you to work 
> across multiple projects easily.
>
> You can also setup local Savant repository to ensure all your 
> dependencies are secure and Savant also allows you to secure the 
> repository using SSL and HTTP basic authentication.
>
> For all the Inversoft projects I use two separate repositories with Savant:
>
>http://savant.inversoft.org  - for all 3rd party and open 
> source dependencies as well as the standard Savant plugins (uses HTTP 
> only with no
> authentication)
>
>https://savant.inversoft.com - for Inversoft dependencies (uses 
> SSL and HTTP basic authentication)
>
> -bp
>
>
>
> On Aug 18, 2009, at 11:43 AM, Boring, Jeff W (N-Viper) wrote:
>
>  Maven is not an option but thanks guys for the opinions! Any ideas 
> about
>> the unable to delete?
>>
>>
>>
>> Jeff
>>
>> Lockheed Martin
>>
>>
>>
>> -Original Message-
>> From: Dominique Devienne [mailto:ddevie...@gmail.com]
>> Sent: Tuesday, August 18, 2009 12:29 PM
>> To: Ant Users List
>> Subject: Re: Unable to delete file
>>
>>
>>
>> On Tue, Aug 18, 2009 at 10:21 AM, Martin Gainty
>> wrote:
>>
>>  here in the US DOD vendors are converting their build.xml and
>>>
>> implementing to maven for:
>>
>>  offline repository(secure from middle-eastern attackers)
>>>
>>
>>  version-specific SCM tagging
>>>
>>
>>  security (ability to enforce SSH handshake to ftp via sftp and scp)
>>>
>>
>>
>>>
>>
>>>
>> http://www.sonatype.com/people/2009/04/how-to-convert-from-ant-to-mav
>> en-
>> in-5-minutes/
>>
>>
>>
>> I'm sure Maven has come a long way since I looked at it,
>>
>> and it does encapsulate a lot of good practices, but it's 
>> my-way-or-the-highway
>>
>> philosophy went against the grain for me.
>>
>>
>>
>> Using Ant doesn't "force" you to have a badly designed monolithic
>>
>> build, although I grant you it doesn't prevent it like Maven does. In
>>
>> the past, if something's wrong with your Maven build, good luck
>>
>> troubleshooting it, whereas Ant is easier IMHO, although again this 
>> is
>>
>> an old experience (and the Maven user list didn't help me solve it
>>
>> either. Hopefully their community has evolved since).
>>
>>
>>
>> Code with non clear dependencies is bad in any build system. Your 
>> blog
>>
>> post IMHO confuses cleaning the code and switching build system. The
>>
>> declarative nature of poms is good, but it can be leveraged using
>>
>> Ivy+Ant rather than Maven.
>>
>>
>>
>> All this to say that going from Ant to Maven is a lot more complex
>>
>> that you make it sound, and that Ant is not really the issue here, 
>> but
>>
>> the design of the code and its build. --DD
>>
>>
>>
>> -
>>
>> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
>>
>> For additional commands, e-mail: user-h...@ant.apache.org
>>
>>
>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional 
> commands, e-mail: user-h...@ant.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org