Update exec tag to include body if set

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113119 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion
2003-03-13 00:31:30 +00:00
parent 53852613d9
commit 20e63ecc57

View File

@@ -14,6 +14,11 @@
! @param command the command to execute
!-->
<define:tag name="exec">
<!-- allow either command attribute or use body of exec tag -->
<j:if test="${empty(command)}">
<j:set var="command" trim="yes"><define:invokeBody/></j:set>
</j:if>
<echo>Executing '${command}' remotely</echo>
<exec dir="." executable="${maven.ssh.executable}">
<arg line='${maven.repo.central} -l ${maven.username} "${command}"'/>
</exec>
@@ -161,7 +166,6 @@
<repository:urlFileName url="${file}" var="fileName"/>
<j:set var="command" value="cd ${directory}"/>
<j:set var="command" value="${command};ln -s ${fileName} ${group}.license"/>
<echo>Executing '${command}' remotely</echo>
<repository:exec command="${command}" />
</j:if>
</x:forEach>
@@ -214,7 +218,6 @@
<j:set var="command" value="${command};chmod g+ws ${groupId}"/>
<j:set var="command" value="${command};chmod -R g+w ${groupId}"/>
<j:set var="command" value="${command};chmod -R a+r ${groupId}"/>
<echo>executing '${command}' remotely</echo>
<repository:exec command="${command}" />
</goal>
@@ -226,13 +229,15 @@
</j:if>
<j:set var="command" value="cd ${maven.repo.central.directory}"/>
<j:set var="command" value="${command};rm -rf ${groupId}" />
<echo>executing '${command}' remotely</echo>
<repository:exec command="${command}" />
</goal>
<!-- this is pretty much a copy of whats in jar:deploy-snapshot -->
<goal name="repository:deploy-snapshot-jar"
description="deploy a snapshot jar, specified by groupId and artifact, to the repository">
<!--
! this is pretty much a copy of whats in jar:deploy-snapshot, except
! this uses any old file for copying, not just the output of the project
!-->
<goal name="repository:copy-snapshot-jar"
description="copy a snapshot jar, specified by groupId and artifact, to the repository">
<j:if test="${empty(artifact)}">
<fail>artifact must be specified</fail>
@@ -256,15 +261,43 @@
<u:file name="${artifact}" var="artifactFile"/>
<j:set var="artifactName">${artifactFile.canonicalFile.name}</j:set>
<j:set var="command" value="cd ${directory}"/>
<j:set var="command" value="${command};md5sum ${artifactName} | sed 's/ .*$//' > ${artifactName}.md5" />
<j:set var="command" value="${command};ln -sf ${artifactName} ${artifactId}-SNAPSHOT.jar"/>
<j:set var="command" value="${command};ln -sf ${artifactName}.md5 ${artifactId}-SNAPSHOT.jar.md5"/>
<j:set var="command" value="${command};echo ${snapshotVersion} > ${artifactId}-snapshot-version"/>
<j:set var="command" value="${command};chmod g+w *"/>
<j:set var="command" value="${command};chgrp ${maven.repository.group} *"/>
<echo>Executing '${command}' remotely</echo>
<repository:exec command="${command}" />
<repository:exec>
cd ${directory};
md5sum ${artifactName} | sed 's/ .*$//' > ${artifactName}.md5;
ln -sf ${artifactName} ${artifactId}-SNAPSHOT.jar;
ln -sf ${artifactName}.md5 ${artifactId}-SNAPSHOT.jar.md5;
echo ${snapshotVersion} > ${artifactId}-snapshot-version;
chgrp ${maven.repository.group} *;
chmod g+w *;
chmod a+r *;
</repository:exec>
</goal>
<!--
! this uses any old file for copying
!-->
<goal name="repository:copy-jar"
description="copy a jar, specified by groupId and artifact, to the repository">
<j:if test="${empty(artifact)}">
<fail>artifact must be specified</fail>
</j:if>
<j:if test="${empty(groupId)}">
<fail>groupId must be specified</fail>
</j:if>
<j:set var="directory" value="${maven.repo.central.directory}/${groupId}/jars/" />
<repository:copy from="${artifact}" toFileOrDir="${directory}" />
<u:file name="${artifact}" var="artifactFile"/>
<j:set var="artifactName">${artifactFile.canonicalFile.name}</j:set>
<repository:exec>
cd ${directory};
md5sum ${artifactName} | sed 's/ .*$//' > ${artifactName}.md5;
chgrp ${maven.repository.group};
chmod g+w;
chmod a+r
</repository:exec>
</goal>
</project>