Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.1.0
-
Fix Version/s: None
-
Component/s: deploy task, install task
-
Labels:None
-
Environment:Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
-
Number of attachments :
Description
When running a built with the following:
<target name="deploy-to-nexus" depends="package" description="Move SVN jars to Nexus"> <artifact:pom id="pom1" groupId="nl.fbn.ullink" artifactId="${module}-${ext}" version="${version}"> <artifact:dependency groupId="junit" artifactId="junit" version="4.1"/> <artifact:dependency groupId="org.codehaus.plexus" artifactId="plexus-utils" version="1.5.5"/> </artifact:pom> <artifact:install file="${workspace}/target/${module}-${ext}.tgz"> <artifact:pom refid="pom1"/> </artifact:install> </target>
The following is logged: [artifact:install] [INFO] Installing e:\tmp\ullink\target\ULBridge_8080-bin.tgz to C:\Users\X09629\.m2\repository\org\apache\maven\super-pom\2.0\super-pom-2.0.jar
It seems the POM definition is not picked up correctly during the install stage.
Issue Links
- is duplicated by
-
MANTTASKS-182
deploy task tries to upload things it shouldn't.
-
I have been looking for a workaround to this... i tried rolling back to maven-ant-tasks-2.0.10.jar but to my surprise it tells me:
artifact:pom doesn't support the "version" attribute
... so I'm guessing that in-memory POMs are not supported in 2.0.10, though there is nothing in the documentation to suggest this (i.e. the example in https://maven.apache.org/ant-tasks/examples/pom.html), whereas the reference does not specify options for in-memory POMs either (https://maven.apache.org/ant-tasks/reference.html#pom).
Until this is fixed, I'm giving up on in-memory POMs, and have presented a workaround in ant below (it's a hack, but at least it's self-contained in a macro). p.s. I love Maven, but whenever it bites me, ant saves the day
{TEMP.DIR}/pom.xml"/><attribute name="pomrefid"/>
<attribute name="groupId"/>
<attribute name="artifactId"/>
<attribute name="version"/>
<attribute name="packaging"/>
<sequential>
<var name="temp.pom.file" unset="true"/>
<var name="temp.pom.file" value="$
<mkdir dir="${TEMP.DIR}
"/>
{line.separator}' file='${temp.pom.file}'/><echo message='<?xml version="1.0" encoding="UTF-8"?>$
<echo message='<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">${line.separator}
' file='$
{temp.pom.file}' append='true'/><echo message=' <modelVersion>4.0.0</modelVersion>${line.separator}' file='${temp.pom.file}
' append='true'/>
{groupId}<echo message=' <groupId>@
</groupId>$
{line.separator}' file='${temp.pom.file}' append='true'/><echo message=' <artifactId>@{artifactId}</artifactId>${line.separator}
' file='$
{temp.pom.file}' append='true'/><echo message=' <version>@{version}</version>${line.separator}' file='${temp.pom.file}
' append='true'/>
{packaging}<echo message=' <packaging>@
</packaging>$
{line.separator}' file='${temp.pom.file}' append='true'/><echo message='</project>${line.separator}
' file='$
{temp.pom.file}' append='true'/><artifact:pom id="@{pomrefid}" file="${temp.pom.file}
"/>
</sequential>
</macrodef>