xeonmailinglist | 29 Jan 16:47 2015
Picon

Ant can't find -factorypath option

Hi,

I am using Apache Ant(TM) version 1.9.3 and during compilation I get the 
error below. It seems that ant does not recognize the option 
|-factorypath|. Is there a way to solve this?

|     [mkdir] Skipping
/home/vagrant/Programs/jikesrvm-3.0.0/target/FastAdaptiveGenMS_airavat_ia32-linux/syscall/java
because it already exists.
      [exec] Current OS is Linux
      [exec] Executing 'apt' with arguments:
      [exec] '-factorypath'
      [exec] '/home/vagrant/Programs/jikesrvm-3.0.0/target/tasks/classes'
      [exec] '-nocompile'
      [exec] '-factory'
      [exec] 'org.jikesrvm.tools.apt.SysCallProcessorFactory'
      [exec] '-classpath'
      [exec] '/home/vagrant/Programs/jikesrvm-3.0.0/target/tasks/classes:/home/vagrant/Programs/jikesrvm-3.0.0/target/vmmagic-stub/classes:/home/vagrant/Programs/jikesrvm-3.0.0/target/FastAdaptiveGenMS_airavat_ia32-linux/classes'
      [exec] '-s'
      [exec] '/home/vagrant/Programs/jikesrvm-3.0.0/target/FastAdaptiveGenMS_airavat_ia32-linux/syscall/java'
      [exec] '/home/vagrant/Programs/jikesrvm-3.0.0/rvm/src/org/jikesrvm/runtime/SysCall.java'
      [exec]
      [exec] The ' characters around the executable and arguments are
      [exec] not part of the command.
Execute:Java13CommandLauncher: Executing 'apt' with arguments:
'-factorypath'
'/home/vagrant/Programs/jikesrvm-3.0.0/target/tasks/classes'
'-nocompile'
'-factory'
'org.jikesrvm.tools.apt.SysCallProcessorFactory'
(Continue reading)

KARR, DAVID | 16 Jan 18:44 2015
Picon

Error about "Provider xx not a subtype" from using Ant XJC task

I'm using the Ant XJC task, and attempting to load two JAXB extensions.  One is a local copy of the "element
wrapper" plugin, and the other the "fluent api".

When I run this, I get the following error:
--------------------
Caused by: java.util.ServiceConfigurationError: com.sun.tools.xjc.Plugin: Provider
dk.conspicio.jaxb.plugins.XmlElementWrapperPlugin not a subtype
	at com.sun.tools.xjc.Options.findServices(Options.java:965)
	at com.sun.tools.xjc.Options.getAllPlugins(Options.java:383)
--------------------

I'm asking this here because I am using an Ant task, so perhaps someone might know what that error message
means.  However, I'm calling this from a Gradle build script.  I'll show that in a moment if that helps to
illuminate anything.

I previously was doing the same work in a Maven POM, using the "cxf-xjc-plugin", which was working fine.

My task looks like this:
-------------------------
task processXSDs() << {
	ant.taskdef(name: 'xjc', classname: 'com.sun.tools.xjc.XJCTask',
				classpath: configurations.jaxb.asPath)
	ant.xjc(destdir: 'tmp', package: "com.att.sunlight.service.domain.serviceCallResults",
extension: true) {
		classpath(path: configurations.jaxb.asPath)
		schema(dir: "src/main/resources/schema", includes: "serviceCallResults.xsd")
        arg(value: "-Xxew")
        arg(value: "-summary target/xew-summary.txt")
        arg(value: "-instantiate lazy")
        arg(value: "-Xfluent-api")
(Continue reading)

Gan Dong | 15 Jan 07:08 2015
Picon

org.apache.tools.ant.property.LocalProperties cannot be extended

Hi experts,

Recently, I came across a problem in Ant and the solution seems to
write a custom LocalProperties implementation to fix the issue. But I
found that this class has a sole privet constructor which prevents me
from sub-classing it:

55     /**
56      * Construct a new LocalProperties object.
57      */
58     private LocalProperties() {
59     }

I'd like to know, is such design on purpose? What's the consideration
in making it private?

I know Ant provided a mechanism as following which seems to have the
ability to register user-defined LocalProperties class:

LocalProperties l = (LocalProperties) project.getReference(
 MagicNames.REFID_LOCAL_PROPERTIES);

(above line is from line 39 of ant source code
https://git-wip-us.apache.org/repos/asf?p=ant.git;a=blob;f=src/main/org/apache/tools/ant/property/LocalProperties.java;h=fb2fa9c0a80a4cadf0fbc3098eedef16fd710aa9;hb=1c927b15af84cfce315a0ef6f4db60c7d47c2c50,
also seen from many other tasks )

But actually it doesn't work as LocalProperties cannot be extended,
thus above assigning would cause class cast issue. So I'm confused, if
this is not supposed to be extended, then what's the point of having
MagicNames.REFID_LOCAL_PROPERTIES?
(Continue reading)

Marcin Zajączkowski | 5 Jan 22:25 2015
Picon

Switch links to image resources on webpage to HTTPS

Hi,

https://ant.apache.org/mail.html (like other ASF pages) works fine when
accessed via HTTPS. However Firefox generates warning about unencrypted
elements on the web page and it is right.

There is a link to:
http://www.apache.org/events/current-event-125x125.png

which is also available through HTTPS. It would be good to switch it to
HTTPS or use "//www.apache.org/events/current-event-125x125.png" to
allow browser to use protocol consistent with the protocol the whole
page is accessed.

Marcin

--

-- 
http://blog.solidsoft.info/ - Working code is not enough
Tanguy Thomas | 3 Jan 18:58 2015
Picon

Ant illegalArgumentException while trying to build automatic translations ("build-lang")

Dear all,

I am relatively new to Ant using, so may I may miss something obvious but I
tried to follow guidelines and search documentation without success.

When I add the <target name="build-lang">...</target-lang> I get an
IllegalArgumentException related to the lang.dir. Ant however does
something, it creates an English version (but not any other translation)
Language_en.properties, and says "build successful" after this exception.
In case this matters, I am using the JDK 1.8.0 (C:\Program
Files\Java\jdk1.8.0_25)

The build.xml is

*<project name="product-registration-TT-portlet" basedir="."
default="deploy"> <import file="../build-common-portlet.xml" /> <target
name="build-lang">  <antcall target="build-lang-cmd">   <param
name="lang.dir" value="docroot/WEB-INF/src/content" />   <param
name="lang.file" value="Language" />   <param name="lang.translate"
value="true" />  </antcall> </target></project>*

And the output is :

*F:\COEProjects\plugins\plugins-lia\portlets\product-registration-TT-portlet>antbuild-langBuildfile:
F:\COEProjects\plugins\plugins-lia\portlets\product-registration-TT-portlet\build.xml*
*build-lang:*

*build-lang-cmd:     [java] Exception in thread "main"
java.lang.IllegalArgumentException: Bad argument
docroot/WEB-INF/src/content     [java]     at
(Continue reading)

YuGiOhJCJ Mailing-List | 31 Dec 00:17 2014
Picon

Execute the target only if source files have changed

Hello,

I have a target that transforms files XCF into PNG by calling the "convert" command.
I would like that this target does not execute if source files (i.e., the XCF files ) have changed.
I have tried with the "uptodate" task but it does not work.
Each time I run ant, the "convert" command is called.

Any idea ?

Thank you.
Best regards.

This is my build.xml file:
<project name="xcf2png" default="png">
	<target name="png-check">
		<uptodate property="png-uptodate" targetfile="png/**.*.png">
			<srcfiles dir= "xcf" includes="**/*.xcf"/>
		</uptodate>
	</target>
	<target name="png" depends="png-check" unless="png-uptodate">
		<mkdir dir="png"/>
		<exec executable="convert">
			<arg value="-verbose"/>
			<arg value="-alpha"/>
			<arg value="on"/>
			<arg value="-background"/>
			<arg value="none"/>
			<arg value="-layers"/>
			<arg value="merge"/>
			<arg value="xcf/icon.xcf"/>
(Continue reading)

Tanguy Thomas | 21 Dec 03:05 2014
Picon

New user (liferay), getting all the time BUILD FAILED message

Hello,

I am not familiar anymore to Java, trying hard to self learn from a
Microsoft development background. I installed Apache Ant, following the
"Liferay in Action" manual. Everything worked fine up to the point of
setting up "hello-world" example with Apache Ant ...

Tomcat is installed (Liferay base portal is working) and Apache Ant is
installed but when I run the command

create.bat hello-world "Hello World"

It takes a lot of time and I get several errors about some of the servers
not available (but I see the ivy cache being loaded with some stuffs). I
tried with and without Windows Firewall turned on.
The output will always be BUILD FAILED:

F:\COEProjects\plugins\liferay-plugins-sdk-6.2\portlets>create.bat
hello-world "
Hello World"
Buildfile: F:\COEProjects\plugins\liferay-plugins-sdk-6.2\portlets\build.xml
[ivy:resolve] :: Apache Ivy 2.3.0 - 20130110142753 ::
http://ant.apache.org/ivy/
 ::
[ivy:resolve] :: loading settings :: file =
F:\COEProjects\plugins\liferay-plugi
ns-sdk-6.2\ivy-settings.xml
[ivy:resolve]
[ivy:resolve] :: problems summary ::
[ivy:resolve] :::: WARNINGS
(Continue reading)

Matt Bertolini | 18 Dec 05:18 2014
Picon

Parse jar:file prefix to Resource

Hi,

I am writing some custom ant tasks and I want to support files inside of
zip/jar files. I have noticed that some ant tasks use the
jar:file:/path/to/a.jar!/path/in/jar/file.xml syntax but I can't seem to
get it work. How do I use this pattern in my tasks and map them to a
Resource object like FileResource, URLResource, etc. Thanks.

Matt Bertolini
Eric Fetzer | 5 Dec 19:24 2014

<exec> kicking my butt with something very simple

All,
I've tried all I can figure out to try on a simple unix command in redhat.  I can run the command line and it works
fine, but ant can't run it to save its life:
<exec executable="sort" dir=".">
  <arg value="-u"/>
  <arg value="existingFile"/>
  <arg value=">"/>
  <arg value="newFile"/>
</exec>
I've tried putting all the args together, putting some of the args together...  If I run it like this, I get
"sort: stat failed: >: No such file or directory.  If I put the "existingFile > newFile" in the same arg, I get
"sort: stat failed existingFile > newFile: No such file or directory.  If I make the executable "bash" and
use "sort" as the first argument, I get:  [exec] /bin/sort: /bin/sort: cannot execute binary file.  If I run
it as bash and put all the arguments into a single arg value, I get: [exec] bash: sort -u existingFile >
newFile: No such file or directory.

This has got to be simple, please help!

Thanks,
Erc
Ryan Payton | 5 Dec 03:13 2014

Problems parsing <at> <at>

Hello,

I am running into an issue using  <at>  <at>  in a .properties file. The variable is
a database password (I also tried using it in the username and still didn't
work), and fails our build since Ant is unable to connect to the database.
However, when I enter  <at>  <at>  <at>  in the .properties file, and leave the DB user's
password with  <at>  <at>  in it then everything works.

Has anyone encountered any issues like this? If so, what was your solution?
Also, would this be considered a bug, and should I file a bug report?

Thank you

This is a customer's issue, and we cannot change the password or use any
workarounds.
Alan Snyder | 10 Nov 22:24 2014

delete task and symlinks

I realize that I am late to the party and that there is an open RFE
<https://issues.apache.org/bugzilla/show_bug.cgi?id=56700> on this issue, but considering how
long this problem has been in existence, I want to make some comments (and maybe rant a bit, too).

First, I cannot tell you how surprised I was when I decided to add a symlink to a build product and suddenly my
build script tried to delete my installation of the JDK! Fortunately, it did not have permission to do so…

Then I checked the documentation. Sure enough, that is how delete works. I investigated alternatives, and
could not find a better one than exec rm. Sad, but true.

OK, so I solved my problem, but for the benefit of those who have not yet encountered this problem, I have to
say that having a delete operation that follows symlinks may be the most surprising and dumb and dangerous
thing I have ever encountered in software, and it is very hard to understand why after all these years it is
still that way. Is there anyone who actually wants this behavior? In other words, does it really need to be
an option or should it just be fixed to never follow symlinks? Even Unix rm does not have a follow-symlinks
option, and Unix was made for power users.

I’ve seen some supposed explanations for this behavior, but they sound lame to me. Some say that Ant
cannot avoid following symlinks because Java doesn’t support them. Well, that’s not true any more.
But regardless, would it not be sufficient to call File.delete() first and only if it fails call
File.isDirectory() to see if iteration is required?

Other comments suggest the problem has to do with file sets and such. I guess I don’t see this. Deleting a
directory (or a symlink that happens to point at a directory) is not a matter of enumerating all the files in
the directory tree and then deleting them. From the point of view of Ant tasks, it should be an atomic
(meaning not composite) operation: call File.delete(), if that fails, check File.isDirectory() and if
true, iterate and recurse. If I tell Ant to delete a bunch of files, that operation should be applied to each
one. If I tell Ant to delete one directory, that operation should be applied to that one directory (or
symlink). If someone wants more control over what gets deleted in a directory, let them specify the set of
files to be deleted.
(Continue reading)


Gmane