add rename-licenses for audit

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112989 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion 2003-02-25 06:00:24 +00:00
parent f72d9aacb0
commit 234a137b13

View File

@ -63,8 +63,13 @@
<!-- set permissions -->
<echo>Setting permissions and group ownership in ${directory}'</echo>
<repository:exec
command="cd ${directory}; chmod -R g+ws *; chmod -R a+r *;chgrp -R maven *" />
<j:set var="command" value="cd ${directory}" />
<j:set var="command" value="${command};chmod -R g+ws *" />
<j:set var="command" value="${command};chmod -R a+r *" />
<j:set var="command" value="${command};chgrp -R maven *" />
<j:set var="command" value="${command};rm ${groupId}.license" />
<j:set var="command" value="${command};ln -s ${fileName} ${groupId}.license" />
<repository:exec command="${command}" />
</define:tag>
<!--
@ -118,7 +123,6 @@
<j:if test="${!processing and group.equals(startProject)}">
<j:set var="processing" value="true"/>
</j:if>
<j:set var="directory" value="${maven.repo.central.directory}/${group}/licenses/" />
<!-- get file and don't let the &amp; get reescaped -->
<x:set var="xfile" select="string($project/file)" />
<j:set var="file" value="${xfile}"/>
@ -129,6 +133,38 @@
</x:forEach>
</goal>
<goal name="repository:audit-rename-licenses"
description="rename/link all licenses from their original name to ${groupId}.license">
<repository:parseAudit var="audit"/>
<!-- see if the user specified a starting project -->
<j:set var="processing" value="true" />
<j:if test="${!empty(startProject)}">
<j:set var="processing" value="false"/>
</j:if>
<x:forEach var="project" select="$audit/licenses/project">
<j:set var="group"><x:expr select="$project/groupId"/></j:set>
<echo>Processing project ${group}</echo>
<j:if test="${!processing and group.equals(startProject)}">
<j:set var="processing" value="true"/>
</j:if>
<j:set var="directory" value="${maven.repo.central.directory}/${group}/licenses/" />
<!-- get file and don't let the &amp; get reescaped -->
<x:set var="xfile" select="string($project/file)" />
<j:set var="file" value="${xfile}"/>
<j:if test="${file != '' and processing}">
<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>
</goal>
<!-- expects groupId to be set -->
<goal name="repository:audit-copy-license"
description="copy the license for the specified groupId to the repository">