From: <jbo...@li...> - 2005-12-09 21:25:50
|
Author: rl...@jb... Date: 2005-12-09 16:25:47 -0500 (Fri, 09 Dec 2005) New Revision: 1766 Modified: trunk/labs/jbossbuild/projects/maven-plugins/artifact-utils/src/main/java/com/stchome/maven/plugins/CopyMojo.java Log: added ability to rename files pulled from the repository Modified: trunk/labs/jbossbuild/projects/maven-plugins/artifact-utils/src/main/java/com/stchome/maven/plugins/CopyMojo.java =================================================================== --- trunk/labs/jbossbuild/projects/maven-plugins/artifact-utils/src/main/java/com/stchome/maven/plugins/CopyMojo.java 2005-12-09 21:19:57 UTC (rev 1765) +++ trunk/labs/jbossbuild/projects/maven-plugins/artifact-utils/src/main/java/com/stchome/maven/plugins/CopyMojo.java 2005-12-09 21:25:47 UTC (rev 1766) @@ -38,6 +38,14 @@ if (!artifact.getFile().exists() || artifactItem.isOverWrite()) { FileUtils.copyFileToDirectory(artifact.getFile(), location); + + if (artifactItem.getRename() != null) + { + File oldFile = FileUtils.resolveFile(location, artifact.getFile().getName()); + File newFile = FileUtils.resolveFile(location, artifactItem.getRename()); + FileUtils.rename(oldFile, newFile); + } + } else { |