Hello there! I'm trying to integrate my build.xml with some artifacts
managed by maven. Here's What I've done so far:

<project name="Project Builder"
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
        
        <property file="build.properties"></property>
        
        <path id="maven-ant-tasks.classpath" path="${maven.lib.dir}" />
         <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
                   uri="antlib:org.apache.maven.artifact.ant"
                   classpathref="maven-ant-tasks.classpath" />

        
        <target name="install-liquid">
                <artifact:pom file="${project.dir}/pom.xml" id="mypom" >
                        
                </artifact:pom>
                
                <artifact:install
file="${project.dir}/${mypom.artifactId}-${my.version}.${mypom.packaging}"
>
                        <pom pomrefid="mypompom" />
                        
                </artifact:install>
        </target>
        
</project>

But running this task throws an exception

Buildfile: build.xml

install-liquid:
BUILD FAILED
java.lang.NullPointerException
        at org.apache.maven.artifact.ant.Pom.getArtifact(Pom.java:133)
        at 
org.apache.maven.artifact.ant.InstallTask.doExecute(InstallTask.java:53)
        at 
org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:678)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
        at org.apache.tools.ant.Main.runBuild(Main.java:758)
        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)

Total time: 0 seconds


I've checked the source, and MavenProject is null. I did not had the
maven jar on my classpath an thought was that. But I've added it and
the problem persist.

Any idea?

Regards

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to