You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marcel Ammerlaan (JIRA)" <ji...@codehaus.org> on 2009/12/22 16:47:55 UTC

[jira] Created: (MANTTASKS-170) deploy / install tasks make up names

deploy / install tasks make up names
------------------------------------

                 Key: MANTTASKS-170
                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
             Project: Maven 2.x Ant Tasks
          Issue Type: Bug
          Components: deploy task, install task
    Affects Versions: 2.1.0
         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
            Reporter: Marcel Ammerlaan


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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANTTASKS-170) deploy / install tasks make up names

Posted by "Greg Vanore (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTTASKS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212868#action_212868 ] 

Greg Vanore commented on MANTTASKS-170:
---------------------------------------

A simpler workaround is to use the writepom task:

<artifact:pom id="temporary" ... >
  ...
</artifact:pom>
<artifact:writepom id="temporary" file="${TEMP.DIR}/pom.xml"/>
<artifact:pom id="@{pomrefid}" file="${TEMP.DIR}/pom.xml"/>

> deploy / install tasks make up names
> ------------------------------------
>
>                 Key: MANTTASKS-170
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: deploy task, install task
>    Affects Versions: 2.1.0
>         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
>            Reporter: Marcel Ammerlaan
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANTTASKS-170) deploy / install tasks make up names

Posted by "Andrew MacLeod (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTTASKS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212288#action_212288 ] 

Andrew MacLeod commented on MANTTASKS-170:
------------------------------------------

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).

I'm going to try and generate XML with writePom and give up on in-memory POMs until this is fixed.

> deploy / install tasks make up names
> ------------------------------------
>
>                 Key: MANTTASKS-170
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: deploy task, install task
>    Affects Versions: 2.1.0
>         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
>            Reporter: Marcel Ammerlaan
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANTTASKS-170) deploy / install tasks make up names

Posted by "Andrew MacLeod (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTTASKS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212288#action_212288 ] 

Andrew MacLeod edited comment on MANTTASKS-170 at 3/3/10 11:52 AM:
-------------------------------------------------------------------

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 :-)
	
	<macrodef name="maven-in-memory-pom-workaround">			
		<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="${TEMP.DIR}/pom.xml"/>
			<mkdir dir="${TEMP.DIR}"/>
			<echo message='&lt;?xml version="1.0" encoding="UTF-8"?&gt;${line.separator}' file='${temp.pom.file}'/>
			<echo message='&lt;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"&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;groupId&gt;@{groupId}&lt;/groupId&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;artifactId&gt;@{artifactId}&lt;/artifactId&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;version&gt;@{version}&lt;/version&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;packaging&gt;@{packaging}&lt;/packaging&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='&lt;/project&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<artifact:pom id="@{pomrefid}" file="${temp.pom.file}"/>
		</sequential>
	</macrodef>


      was (Author: andrew.macleod):
    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 going to generate an actual temporary POM file using ant <echo> and give up on in-memory POMs (when ever Maven bites me, ant saves the day :-) ).
  
> deploy / install tasks make up names
> ------------------------------------
>
>                 Key: MANTTASKS-170
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: deploy task, install task
>    Affects Versions: 2.1.0
>         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
>            Reporter: Marcel Ammerlaan
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANTTASKS-170) deploy / install tasks make up names

Posted by "Greg Vanore (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTTASKS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212868#action_212868 ] 

Greg Vanore edited comment on MANTTASKS-170 at 3/5/10 3:13 PM:
---------------------------------------------------------------

A simpler workaround is to use the writepom task:

Declare your in-memory pom:
<artifact:pom id="template" ... >
  ...
</artifact:pom>

<macrodef name="bug170workaround">
  <attribute name="srcpom"/>
  <attribute name="destpom"/>
  <attribute name="dir" default="${TEMP.DIR}"/>
  <sequential>
    <artifact:writepom id="@{srcpom}" file="@{dir}/pom.xml"/>
    <artifact:pom id="@{destpom}" file="@{dir}/pom.xml"/>
  </sequential>
</macrodef>

[edit: improved snippet]

      was (Author: gvanore):
    A simpler workaround is to use the writepom task:

<artifact:pom id="temporary" ... >
  ...
</artifact:pom>
<artifact:writepom id="temporary" file="${TEMP.DIR}/pom.xml"/>
<artifact:pom id="@{pomrefid}" file="${TEMP.DIR}/pom.xml"/>
  
> deploy / install tasks make up names
> ------------------------------------
>
>                 Key: MANTTASKS-170
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: deploy task, install task
>    Affects Versions: 2.1.0
>         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
>            Reporter: Marcel Ammerlaan
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MANTTASKS-170) deploy / install tasks make up names

Posted by "Herve Boutemy (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MANTTASKS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy updated MANTTASKS-170:
------------------------------------

    Description: 
When running a built with the following:
{code:xml}<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>{code}

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.

  was:
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.


> deploy / install tasks make up names
> ------------------------------------
>
>                 Key: MANTTASKS-170
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: deploy task, install task
>    Affects Versions: 2.1.0
>         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
>            Reporter: Marcel Ammerlaan
>
> When running a built with the following:
> {code:xml}<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>{code}
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANTTASKS-170) deploy / install tasks make up names

Posted by "Andrew MacLeod (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTTASKS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212288#action_212288 ] 

Andrew MacLeod edited comment on MANTTASKS-170 at 3/3/10 7:56 AM:
------------------------------------------------------------------

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 going to generate an actual temporary POM file using ant <echo> and give up on in-memory POMs (when ever Maven bites me, ant saves the day :-) ).

      was (Author: andrew.macleod):
    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).

I'm going to try and generate XML with writePom and give up on in-memory POMs until this is fixed.
  
> deploy / install tasks make up names
> ------------------------------------
>
>                 Key: MANTTASKS-170
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: deploy task, install task
>    Affects Versions: 2.1.0
>         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
>            Reporter: Marcel Ammerlaan
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MANTTASKS-170) deploy / install tasks make up names

Posted by "sixman9 (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTTASKS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=251933#action_251933 ] 

sixman9 commented on MANTTASKS-170:
-----------------------------------

Hi guys,
Thanks for the workaround, however, I believe the snippet should contain the 'pomrefid' instead of solely 'id' on the <artifact:writepom> node, thus:

<artifact:writepom id="@{srcpom}" file="@{dir}/pom.xml"/>

should read

<artifact:writepom *pomrefid*="@{srcpom}" file="@{dir}/pom.xml"/>

Hope this helps

Cheers

Rich

> deploy / install tasks make up names
> ------------------------------------
>
>                 Key: MANTTASKS-170
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: deploy task, install task
>    Affects Versions: 2.1.0
>         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
>            Reporter: Marcel Ammerlaan
>
> When running a built with the following:
> {code:xml}<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>{code}
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MANTTASKS-170) deploy / install tasks make up names

Posted by "Andrew MacLeod (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MANTTASKS-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=212288#action_212288 ] 

Andrew MacLeod edited comment on MANTTASKS-170 at 3/3/10 11:53 AM:
-------------------------------------------------------------------

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 :-)
			<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="${TEMP.DIR}/pom.xml"/>
			<mkdir dir="${TEMP.DIR}"/>
			<echo message='&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;${line.separator}' file='${temp.pom.file}'/>
			<echo message='&amp;lt;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"&amp;gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &amp;lt;groupId&amp;gt;@{groupId}&amp;lt;/groupId&amp;gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &amp;lt;artifactId&amp;gt;@{artifactId}&amp;lt;/artifactId&amp;gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &amp;lt;version&amp;gt;@{version}&amp;lt;/version&amp;gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &amp;lt;packaging&amp;gt;@{packaging}&amp;lt;/packaging&amp;gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='&amp;lt;/project&amp;gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<artifact:pom id="@{pomrefid}" file="${temp.pom.file}"/>
		</sequential>
	</macrodef>


      was (Author: andrew.macleod):
    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 :-)
	
	<macrodef name="maven-in-memory-pom-workaround">			
		<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="${TEMP.DIR}/pom.xml"/>
			<mkdir dir="${TEMP.DIR}"/>
			<echo message='&lt;?xml version="1.0" encoding="UTF-8"?&gt;${line.separator}' file='${temp.pom.file}'/>
			<echo message='&lt;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"&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;groupId&gt;@{groupId}&lt;/groupId&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;artifactId&gt;@{artifactId}&lt;/artifactId&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;version&gt;@{version}&lt;/version&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='    &lt;packaging&gt;@{packaging}&lt;/packaging&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<echo message='&lt;/project&gt;${line.separator}' file='${temp.pom.file}' append='true'/>
			<artifact:pom id="@{pomrefid}" file="${temp.pom.file}"/>
		</sequential>
	</macrodef>

  
> deploy / install tasks make up names
> ------------------------------------
>
>                 Key: MANTTASKS-170
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-170
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: deploy task, install task
>    Affects Versions: 2.1.0
>         Environment: Windows Vista/Ant 1.7.1/Maven ant tasks 2.1.0
>            Reporter: Marcel Ammerlaan
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira