0

I desperately try to pass args to my java program.

I do this:

    <java classname="com.openedi.unece.xsd.XSDFileGenerator" fork="true">
        <arg value="-version"/>
        <arg value="${version.uppercase}"/>
        <arg value="-directoryName"/>
        <arg value="${project.dir}"/>
        <arg value="-messageType"/>
        <arg value="${messageType}"/>                       
        <classpath>
            <pathelement location="${lib.dir}/EdifactConverter.jar" />
        </classpath>
    </java>

All the properties have default values set in the build script, but it does not work.

Thanks for suggestions

Matthias

1
  • 1
    How does it "not work"? Do you get an error message? Commented Dec 16, 2014 at 9:32

1 Answer 1

1

Make sure you set the default values correctly. A complete ant script could look like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="start" name="Test">
    <property name="version.uppercase" value="AAA"/>
    <property name="project.dir" value="PATH/TO/DIR"/>
    <property name="messageType" value="MESSAGETYPE"/>
    <property name="lib.dir" value="PATH/TO/LIB"/>
    <target name="start">
        <java classname="com.openedi.unece.xsd.XSDFileGenerator" fork="true">
            <arg value="-version"/>
            <arg value="${version.uppercase}"/>
            <arg value="-directoryName"/>
            <arg value="${project.dir}"/>
            <arg value="-messageType"/>
            <arg value="${messageType}"/>                       
            <classpath>
                <pathelement location="${lib.dir}/EdifactConverter.jar" />
            </classpath>
        </java>
    </target>
</project>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.