maven-antrun-plugin-1.7/0000755000175000017500000000000012147706602014625 5ustar ebourgebourgmaven-antrun-plugin-1.7/pom.xml0000644000175000017500000001003411652641021016131 0ustar ebourgebourg 4.0.0 maven-plugins org.apache.maven.plugins 22 ../maven-plugins/pom.xml maven-antrun-plugin 1.7 maven-plugin Maven AntRun Plugin Runs Ant scripts embedded in the POM ${mavenVersion} scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-antrun-plugin-1.7 scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-antrun-plugin-1.7 http://svn.apache.org/viewvc/maven/plugins/tags/maven-antrun-plugin-1.7 jira http://jira.codehaus.org/browse/MANTRUN 2.0.11 org.apache.maven maven-plugin-api ${mavenVersion} org.apache.maven maven-project ${mavenVersion} org.apache.maven maven-artifact ${mavenVersion} org.codehaus.plexus plexus-utils 2.0.5 org.apache.ant ant 1.8.2 run-its maven-invoker-plugin 1.5 true src/it ${project.build.directory}/it **/pom.xml pom.xml verify ${project.build.directory}/local-repo src/it/settings.xml integration-test install run maven-antrun-plugin-1.7/src/0000755000175000017500000000000012147706601015413 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/0000755000175000017500000000000012147706602016030 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/ant-1.7-features/0000755000175000017500000000000012147706601020730 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/ant-1.7-features/pom.xml0000644000175000017500000000355111123236157022246 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun antrun-plugin-test 1.0-SNAPSHOT Test for MANTRUN-68 org.apache.maven.plugins maven-antrun-plugin @pom.version@ test run maven-antrun-plugin-1.7/src/it/ant-1.7-features/verify.bsh0000644000175000017500000000056711123236157022737 0ustar ebourgebourgimport java.io.*; import org.codehaus.plexus.util.*; try { File xmlFile = new File( basedir, "echo.xml" ); String xml = FileUtils.fileRead( xmlFile, "UTF-8" ); if ( xml.indexOf( " P1: ${property1} P2: ${property2} P3: ${property3} maven-antrun-plugin-1.7/src/it/properties-attributes-test/pom.xml0000644000175000017500000000527011413252651024701 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun properties-attributes-test 1.0-SNAPSHOT Test for MANTRUN-36 properties not resolved in attributes xyz maven-antrun-plugin @pom.version@ test Embedded tasks: P1: ${property1} P2: ${property2} P3: ${property3} mavenProperty: ${mavenProperty} run maven-antrun-plugin-1.7/src/it/tasksattributes-test/0000755000175000017500000000000012147706602022241 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/tasksattributes-test/pom.xml0000644000175000017500000000445411046116526023562 0ustar ebourgebourg 4.0.0 antrun-plugin.test antrun-plugin-test jar 1.0-SNAPSHOT 2006 Maven Antrun Plugin Test http://maven.apache.org org.apache.maven.plugins maven-antrun-plugin @pom.version@ if compile [ANTRUN-OUTPUT-MARKER:IF] run unless compile [ANTRUN-OUTPUT-MARKER:UNLESS] run maven-antrun-plugin-1.7/src/it/tasksattributes-test/test.properties0000644000175000017500000000002511046116526025330 0ustar ebourgebourgmaven.test.skip=true maven-antrun-plugin-1.7/src/it/tasksattributes-test/verify.bsh0000644000175000017500000000126111242275445024244 0ustar ebourgebourgimport java.io.*; import java.util.*; import java.util.regex.*; import org.codehaus.plexus.util.*; try { File buildLog = new File( basedir, "build.log" ); String log = FileUtils.fileRead( buildLog ); if ( log.indexOf( "[echo] [ANTRUN-OUTPUT-MARKER:IF]" ) < 0 ) { System.err.println( "Generated console output does not contain expected marker output" ); return false; } if ( log.indexOf( "[echo] [ANTRUN-OUTPUT-MARKER:UNLESS]" ) >= 0 ) { System.err.println( "Generated console output contains unexpected marker output" ); return false; } } catch( Throwable t ) { t.printStackTrace(); return false; } return true; maven-antrun-plugin-1.7/src/it/never-fail-test/0000755000175000017500000000000012147706601021034 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/never-fail-test/pom.xml0000644000175000017500000000327511652600353022355 0ustar ebourgebourg 4.0.0 antrun-plugin.test antrun-plugin-never-fail-test jar 1.0-SNAPSHOT 2011 Never Fail test for Antrun http://maven.apache.org org.apache.maven.plugins maven-antrun-plugin @pom.version@ false This is a failure maven-antrun-plugin-1.7/src/it/never-fail-test/invoker.properties0000644000175000017500000000011611652575065024635 0ustar ebourgebourginvoker.goals=${project.groupId}:${project.artifactId}:${project.version}:run maven-antrun-plugin-1.7/src/it/env-var-test/0000755000175000017500000000000012147706601020362 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/env-var-test/build.xml0000644000175000017500000000051510355545134022205 0ustar ebourgebourg user.home = ${user.home} maven-antrun-plugin-1.7/src/it/env-var-test/pom.xml0000644000175000017500000000320211413252651021670 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun env-var-test 1.0-SNAPSHOT Test for MANTRUN-32 ant tasks don't use correct environment in antrun plugin junit junit 3.8.2 test maven-antrun-plugin @pom.version@ test user.home = ${user.home} run maven-antrun-plugin-1.7/src/it/antrun-default-test/0000755000175000017500000000000012147706602021736 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/antrun-default-test/pom.xml0000644000175000017500000000352611046116526023256 0ustar ebourgebourg 4.0.0 antrun-plugin.test antrun-plugin-test jar 1.0-SNAPSHOT 2006 Maven Antrun Plugin Test http://maven.apache.org junit junit 3.8.2 test org.apache.maven.plugins maven-antrun-plugin @pom.version@ maven-antrun-plugin-1.7/src/it/antrun-default-test/invoker.properties0000644000175000017500000000011611046116526025524 0ustar ebourgebourginvoker.goals=${project.groupId}:${project.artifactId}:${project.version}:run maven-antrun-plugin-1.7/src/it/antrun-default-test/verify.bsh0000644000175000017500000000074311046116526023741 0ustar ebourgebourgimport java.io.*; import java.util.*; import java.util.regex.*; import org.codehaus.plexus.util.*; try { File buildLog = new File( basedir, "build.log" ); String log = FileUtils.fileRead( buildLog ); if ( log.indexOf( "[echo] Hello World!" ) < 0 ) { System.err.println( "Generated console output does not contain [echo] output: " + buildLog ); return false; } } catch( Throwable t ) { t.printStackTrace(); return false; } return true; maven-antrun-plugin-1.7/src/it/settings.xml0000644000175000017500000000317411257425203020413 0ustar ebourgebourg it-repo true local.central @localRepositoryUrl@ true true local.central @localRepositoryUrl@ true true maven-antrun-plugin-1.7/src/it/plugin-classpath-test/0000755000175000017500000000000012147706601022262 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/plugin-classpath-test/build.xml0000644000175000017500000000054710711321270024077 0ustar ebourgebourg maven-antrun-plugin-1.7/src/it/plugin-classpath-test/calc.g0000644000175000017500000000115310357473002023331 0ustar ebourgebourgclass CalcParser extends Parser; options { buildAST = true; // uses CommonAST by default } expr : mexpr (PLUS^ mexpr)* SEMI! ; mexpr : atom (STAR^ atom)* ; atom: INT ; class CalcLexer extends Lexer; WS : (' ' | '\t' | '\n' | '\r') { _ttype = Token.SKIP; } ; LPAREN: '(' ; RPAREN: ')' ; STAR: '*' ; PLUS: '+' ; SEMI: ';' ; protected DIGIT : '0'..'9' ; INT : (DIGIT)+ ; class CalcTreeWalker extends TreeParser; expr returns [float r] { float a,b; r=0; } : #(PLUS a=expr b=expr) {r = a+b;} | #(STAR a=expr b=expr) {r = a*b;} | i:INT {r = (float)Integer.parseInt(i.getText());} ; maven-antrun-plugin-1.7/src/it/plugin-classpath-test/pom.xml0000644000175000017500000000327511413252651023602 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun plugin-classpath-test 1.0-SNAPSHOT Test for plugin classpath references and optional ant tasks Ensure that maven.plugin.classpath reference is set and optional tasks work org.apache.maven.plugins maven-antrun-plugin @pom.version@ compile compile run ant ant-antlr 1.6.5 antlr antlrall 2.7.4 maven-antrun-plugin-1.7/src/it/attach-artifact-test/0000755000175000017500000000000012147706602022044 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/attach-artifact-test/pom.xml0000644000175000017500000000420511451430076023356 0ustar ebourgebourg 4.0.0 antrun-plugin.test antrun-plugin-attach-artifact-test pom 1.0-SNAPSHOT 2006 Maven Antrun Plugin Test http://maven.apache.org org.apache.maven.plugins maven-antrun-plugin @pom.version@ attach-artifact-test package run maven-antrun-plugin-1.7/src/it/attach-artifact-test/invoker.properties0000644000175000017500000000002611375404231025630 0ustar ebourgebourginvoker.goals=install maven-antrun-plugin-1.7/src/it/attach-artifact-test/verify.bsh0000644000175000017500000000203311557265734024056 0ustar ebourgebourgimport java.io.*; import java.util.*; import java.util.regex.*; import org.codehaus.plexus.util.*; try { String zipFilePath = "../../local-repo/antrun-plugin/test/antrun-plugin-attach-artifact-test/1.0-SNAPSHOT/antrun-plugin-attach-artifact-test-1.0-SNAPSHOT-foo.zip"; File installedZipFile = new File( basedir, zipFilePath ); if ( ! installedZipFile.exists() ) { System.out.println( "Zip file not installed: " + installedZipFile ); return false; } String zipWithouClassifierFilePath = "../../local-repo/antrun-plugin/test/antrun-plugin-attach-artifact-test/1.0-SNAPSHOT/antrun-plugin-attach-artifact-test-1.0-SNAPSHOT.zip"; File installedZipWithouClassifierFile = new File( basedir, zipWithouClassifierFilePath ); if ( ! installedZipWithouClassifierFile.exists() ) { System.out.println( "Zip file (without classifier) not installed: " + installedZipWithouClassifierFile ); return false; } } catch( Throwable t ) { t.printStackTrace(); return false; } return true; maven-antrun-plugin-1.7/src/it/copy-fail-test/0000755000175000017500000000000012147706601020667 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/copy-fail-test/stuff/0000755000175000017500000000000012147706601022016 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/copy-fail-test/stuff/test2.txt0000644000175000017500000000000511413305106023601 0ustar ebourgebourgtest2maven-antrun-plugin-1.7/src/it/copy-fail-test/stuff/test1.txt0000644000175000017500000000000511413305106023600 0ustar ebourgebourgtest1maven-antrun-plugin-1.7/src/it/copy-fail-test/pom.xml0000644000175000017500000000423611413305106022177 0ustar ebourgebourg 4.0.0 antrun-plugin.test antrun-plugin-test jar 1.0-SNAPSHOT 2006 Maven Antrun Plugin Test http://maven.apache.org org.apache.maven.plugins maven-antrun-plugin @pom.version@ maven-antrun-plugin-1.7/src/it/copy-fail-test/invoker.properties0000644000175000017500000000011611413276170024456 0ustar ebourgebourginvoker.goals=${project.groupId}:${project.artifactId}:${project.version}:run maven-antrun-plugin-1.7/src/it/classpath-test-scope-test/0000755000175000017500000000000012147706601023052 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/classpath-test-scope-test/pom.xml0000644000175000017500000000321611413252651024365 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun classpath-test-scope 1.0-SNAPSHOT Test for MANTRUN-28 maven.test.classpath doesn't contain test scope dependancies junit junit 3.8.2 test maven-antrun-plugin @pom.version@ test ${test.classpath} run maven-antrun-plugin-1.7/src/it/task-encoding-test/0000755000175000017500000000000012147706601021532 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/task-encoding-test/pom.xml0000644000175000017500000000412211453160662023046 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun mantrun-155 1.0-SNAPSHOT pom mantrun-155 UTF-8 org.apache.maven.plugins maven-antrun-plugin @pom.version@ antrun test run maven-antrun-plugin-1.7/src/it/filesets-test/0000755000175000017500000000000012147706601020622 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/filesets-test/goals.txt0000644000175000017500000000003011350722655022463 0ustar ebourgebourgclean generate-resourcesmaven-antrun-plugin-1.7/src/it/filesets-test/pom.xml0000755000175000017500000000366711350722655022160 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun properties-test 1.0-SNAPSHOT Test for passing properties to the ant build Test for passing properties to the ant build org.apache.maven.plugins maven-antrun-plugin @pom.version@ antrun generate-resources run org.apache.ant ant 1.7.1 junit junit 3.8.2 maven-antrun-plugin-1.7/src/it/filesets-test/src/0000755000175000017500000000000012147706601021411 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/filesets-test/src/main/0000755000175000017500000000000012147706601022335 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/filesets-test/src/main/java/0000755000175000017500000000000012147706601023256 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/filesets-test/src/main/java/Test.java0000644000175000017500000000015611350722655025044 0ustar ebourgebourgpublic class Test { public static void main(String args[]) { System.out.println("done"); } }maven-antrun-plugin-1.7/src/it/filesets-test/verify.bsh0000644000175000017500000000223611557265734022642 0ustar ebourgebourgimport java.io.*; import java.util.*; import java.util.regex.*; import org.codehaus.plexus.util.*; try { File depsDir = new File( basedir, "target/dependencies" ); File antJar = new File( depsDir, "ant-1.7.1.jar" ); File junitJar = new File( depsDir, "junit-3.8.2.jar" ); if ( ! antJar.exists() || antJar.isDirectory() ) { System.out.println( "Ant jar file does not exist: " + antJar ); return false; } if ( ! junitJar.exists() || junitJar.isDirectory() ) { System.out.println( "Junit jar file does not exist: " + junitJar ); return false; } File deps2Dir = new File( basedir, "target/dependencies2" ); antJar = new File( deps2Dir, "ant-1.7.1.jar" ); junitJar = new File( deps2Dir, "junit-3.8.2.jar" ); if ( ! antJar.exists() || antJar.isDirectory() ) { System.out.println( "Ant jar file does not exist: " + antJar ); return false; } if ( ! junitJar.exists() || junitJar.isDirectory() ) { System.out.println( "Junit jar file does not exist: " + junitJar ); return false; } } catch( Throwable t ) { t.printStackTrace(); return false; } return true; maven-antrun-plugin-1.7/src/it/properties-test/0000755000175000017500000000000012147706602021201 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/properties-test/build.xml0000755000175000017500000000447411421624516023033 0ustar ebourgebourg maven-antrun-plugin-1.7/src/it/properties-test/pom.xml0000755000175000017500000000333711421624516022524 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun properties-test 1.0-SNAPSHOT Test for passing properties to the ant build Test for passing properties to the ant build junit junit 3.8.2 target/test-stuff org.apache.maven.plugins maven-antrun-plugin @pom.version@ antrun generate-resources run testProp1-value property-profile the profile property maven-antrun-plugin-1.7/src/it/properties-test/invoker.properties0000644000175000017500000000011411421624516024765 0ustar ebourgebourginvoker.goals = clean generate-resources invoker.profiles = property-profilemaven-antrun-plugin-1.7/src/it/properties-test/src/0000755000175000017500000000000012147706602021770 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/properties-test/src/main/0000755000175000017500000000000012147706602022714 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/properties-test/src/main/java/0000755000175000017500000000000012147706602023635 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/properties-test/src/main/java/Test.java0000644000175000017500000000015611222510263025406 0ustar ebourgebourgpublic class Test { public static void main(String args[]) { System.out.println("done"); } }maven-antrun-plugin-1.7/src/it/classpath-ref-test/0000755000175000017500000000000012147706602021541 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/classpath-ref-test/build.xml0000644000175000017500000000036310346730265023365 0ustar ebourgebourg maven-antrun-plugin-1.7/src/it/classpath-ref-test/pom.xml0000644000175000017500000000366711413252651023065 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun test-classpaths 1.0-SNAPSHOT Test for compile and plugin classpath references Ensure that maven.compile.classpath and maven.plugin.classpath referencies are set junit junit 3.8.2 org.apache.maven.plugins maven-antrun-plugin @pom.version@ compile compile target/generated/src/main/java run maven-antrun-plugin-1.7/src/it/classpath-ref-test/src/0000755000175000017500000000000012147706602022330 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/classpath-ref-test/src/main/0000755000175000017500000000000012147706602023254 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/classpath-ref-test/src/main/java/0000755000175000017500000000000012147706602024175 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/classpath-ref-test/src/main/java/Test.java0000644000175000017500000000015611123544663025761 0ustar ebourgebourgpublic class Test { public static void main(String args[]) { System.out.println("done"); } }maven-antrun-plugin-1.7/src/it/multiple-phase-test/0000755000175000017500000000000012147706602021736 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/multiple-phase-test/goals.txt0000644000175000017500000000002211401521076023566 0ustar ebourgebourggenerate-resourcesmaven-antrun-plugin-1.7/src/it/multiple-phase-test/pom.xml0000644000175000017500000000435311401521076023250 0ustar ebourgebourg 4.0.0 antrun-plugin.test antrun-plugin-test jar 1.0-SNAPSHOT Maven Antrun Plugin Test http://maven.apache.org org.apache.maven.plugins maven-antrun-plugin @pom.version@ phase-1 run validate phase-2 run generate-resources maven-antrun-plugin-1.7/src/it/multiple-phase-test/verify.bsh0000644000175000017500000000110611557265734023750 0ustar ebourgebourgimport java.io.*; import java.util.*; import java.util.regex.*; import org.codehaus.plexus.util.*; try { File phase1 = new File( basedir, "phase-1.txt" ); if ( ! phase1.exists() ) { System.err.println( "Could not find Ant generated file: " + phase1 ); return false; } File phase2 = new File( basedir, "phase-2.txt" ); if ( ! phase2.exists() ) { System.err.println( "Could not find Ant generated file: " + phase2 ); return false; } } catch( Throwable t ) { t.printStackTrace(); return false; } return true; maven-antrun-plugin-1.7/src/it/local-repo-prop-test/0000755000175000017500000000000012147706601022017 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/local-repo-prop-test/pom.xml0000644000175000017500000000463411413265425023342 0ustar ebourgebourg 4.0.0 antrun-plugin.test antrun-plugin-test jar 1.0-SNAPSHOT 2006 Maven Antrun Plugin Test - Local Repo Prop [MANTRUN-143] http://maven.apache.org junit junit 3.8.2 test org.apache.maven.plugins maven-antrun-plugin @pom.version@ maven-antrun-plugin-1.7/src/it/local-repo-prop-test/invoker.properties0000644000175000017500000000011611413260320025574 0ustar ebourgebourginvoker.goals=${project.groupId}:${project.artifactId}:${project.version}:run maven-antrun-plugin-1.7/src/it/custom-task-test/0000755000175000017500000000000012147706601021256 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/custom-task-test/build.xml0000644000175000017500000000203010355545134023073 0ustar ebourgebourg P1: ${property1} P2: ${property2} P3: ${property3} maven-antrun-plugin-1.7/src/it/custom-task-test/pom.xml0000644000175000017500000000343611413252651022575 0ustar ebourgebourg 4.0.0 org.apache.maven.plugins.antrun custom-task-test 1.0-SNAPSHOT Test for MANTRUN-34 StringIndexOutOfBoundsException in custom ant task referencing 'basedir' ant ant 1.6.5 maven-antrun-plugin @pom.version@ test run maven-antrun-plugin-1.7/src/it/custom-task-test/src/0000755000175000017500000000000012147706601022045 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/custom-task-test/src/main/0000755000175000017500000000000012147706601022771 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/custom-task-test/src/main/java/0000755000175000017500000000000012147706601023712 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/it/custom-task-test/src/main/java/TestTask.java0000644000175000017500000000076311123544663026326 0ustar ebourgebourgimport org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; public class TestTask extends Task { public void execute() throws BuildException { Project p = this.getProject(); System.out.println("sourceDirectory:" + p.getProperty("project.build.sourceDirectory")); System.out.println("project.cmdline:" + p.getProperty("project.cmdline")); System.out.println("basedir:" + p.getProperty("basedir")); } } maven-antrun-plugin-1.7/src/site/0000755000175000017500000000000012147706601016357 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/site/fml/0000755000175000017500000000000012147706601017135 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/site/fml/faq.fml0000644000175000017500000000512511236276131020405 0ustar ebourgebourg Why use antrun and not the Ant program itself?

Maven has certain benefits over Ant. And for your Ant projects to take advantage of these, you can use Maven as your project management tool and use its maven-antrun-plugin to build your Ant projects.

Furthermore, if you wish to migrate from Ant to Maven, you can use this plugin first, then gradually convert your Ant expressions into their corresponding Maven expressions.

Why is antrun not correctly handling my plugin dependency in a multi-module build?

There is a problem in some versions of Maven (earlier than 3.0-alpha-1) that prevent Maven from correctly resolving plugin dependencies in a multi-module build (MNG-1323). This means that if you have multiple modules in your project and the antrun plugin declares a different set of dependencies, only the first declaration found will be used.

The workaround for this is to specify the same set of plugin dependencies for all declarations of the antrun plugin. Another option is to move the plugin dependencies to the project level and set the scope to "provided". For more information, see MANTRUN-51 and MANTRUN-106.

maven-antrun-plugin-1.7/src/site/site.xml0000644000175000017500000000334411444231356020050 0ustar ebourgebourg maven-antrun-plugin-1.7/src/site/apt/0000755000175000017500000000000012147706601017143 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/site/apt/tasks/0000755000175000017500000000000012147706601020270 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/site/apt/tasks/dependencyFilesets.apt.vm0000644000175000017500000000771111444231356025241 0ustar ebourgebourg ------ DependencyFileSets Task ------ Paul Gier ------ March 2010 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html DependencyFilesets Task This task will create fileset objects containing the Maven project dependencies. This can be used access specific dependency artifacts, or to operate on a set of dependency artifacts. Each artifact will be assigned a fileset ID in the form <<<[prefix]groupId:artifactId:[classifier]:type>>>. A dependency on a junit jar would be given a fileset ID of <<>>. In addition, a single fileset containing all the project dependencies will be created using the default ID maven.project.dependencies * Task Parameters *---------------+--------------------------------------------------------+-----------------------------------* || Attribute || Description || Required | *---------------+--------------------------------------------------------+-----------------------------------* | prefix | String to prepend to all fileset IDs | No, defaults to empty string | *---------------+--------------------------------------------------------+-----------------------------------* | projectDependenciesId | RefId for the fileset containing all project dependencies | No, defaults to "maven.project.dependencies | *---------------+--------------------------------------------------------+-----------------------------------* | scopes | Comma separated list of artifact scopes to include | No, defaults to all artifacts | *---------------+--------------------------------------------------------+-----------------------------------* | types | Comma separated list of artifact types to include | No, defaults to all artifacts | *---------------+--------------------------------------------------------+-----------------------------------* * Example This example shows how to access individual dependencies and the combined dependency fileset. ------ org.apache.maven.plugins maven-antrun-plugin ${project.version} copy-dependencies package run ------ maven-antrun-plugin-1.7/src/site/apt/tasks/tasks.apt.vm0000644000175000017500000000412711375572540022555 0ustar ebourgebourg ------ Ant Tasks ------ Paul Gier ------ March 2010 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Ant Tasks The Maven Antrun Plugin includes some custom Ant tasks which can be used to better integrate with the Maven build. This page provides an overview of these tasks. Click on the task name for more information and examples. *-----------------------------------------------------+--------------------------------------------------------+ || Task || Description | *---------------+--------------------------------------------------------+ | {{{./attachArtifact.html}attachartifact}} | Attach an artifact to the current Maven project | *---------------+--------------------------------------------------------+ | {{{./dependencyFilesets.html}dependencyfilesets}} | Creates a fileset for each of the Maven project dependencies and adds them to the Ant build | *---------------+--------------------------------------------------------+ | {{{./versionMapper.html}versionMapper}} | Mapper to remove version from artifact filenames | *---------------+--------------------------------------------------------+ maven-antrun-plugin-1.7/src/site/apt/tasks/versionMapper.apt.vm0000644000175000017500000000426311444231356024255 0ustar ebourgebourg ------ VersionMapper ------ Paul Gier ------ May 2010 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html VersionMapper This is an Ant mapper class which can be used to remove the versions from the dependency artifact filenames.. * Example This example shows how to use the version mapper. ------ org.apache.maven.plugins maven-antrun-plugin ${project.version} copy-dependencies package run ------ maven-antrun-plugin-1.7/src/site/apt/tasks/attachArtifact.apt.vm0000644000175000017500000000574411444231356024352 0ustar ebourgebourg ------ AttachArtifact Task ------ Paul Gier ------ May 2010 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html AttachArtifact Task This task will attatch an artifact to the current Maven project. This is can be used to install and deploy an artifact generated by the Ant tasks. * Task Parameters *---------------+--------------------------------------------------------+-----------------------------------* || Attribute || Description || Required | *---------------+--------------------------------------------------------+-----------------------------------* | file | The file to attach to the project | Yes | *---------------+--------------------------------------------------------+-----------------------------------* | classifier | A classifier assigned to the artifact | No, defaults to no classifier | *---------------+--------------------------------------------------------+-----------------------------------* | type | The type of the artifact, zip, war, etc | No, defaults to jar | *---------------+--------------------------------------------------------+-----------------------------------* * Example This example shows how to use the <<>> task. ------ org.apache.maven.plugins maven-antrun-plugin ${project.version} attach-artifact package run ------ maven-antrun-plugin-1.7/src/site/apt/index.apt0000644000175000017500000000716511456567161021001 0ustar ebourgebourg ------ Introduction ------ Kenney Westerhof, Franz Allan Valencia See ------ September 2006 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Maven AntRun Plugin This plugin provides the ability to run Ant tasks from within Maven. You can even embed your Ant scripts in the POM! It is the intention of this plugin to provide a means of polluting the POM, so it's encouraged to move all your Ant tasks to a <<>> file and just call it from the POM using Ant's {{{http://ant.apache.org/manual/CoreTasks/ant.html}\ task}}. One of the main purposes of this plugin is to facilitate the migration from Ant based projects to Maven. Some projects may not currently be able to migrate because they depend on custom build functionality that Maven doesn't provide by default. * Goals Overview * {{{./run-mojo.html}antrun:run}} runs Ant tasks for Maven. * Usage General instructions on how to use the AntRun Plugin can be found on the {{{./usage.html}usage page}}. Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the {{{http://docs.codehaus.org/display/MAVENUSER/Antrun+Plugin}plugin's wiki page}}. In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the {{{./mail-lists.html}mail archive}}. If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our {{{./source-repository.html}source repository}} and will find supplementary information in the {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. * Examples To provide you with better understanding on some usages of the Maven AntRun Plugin, you can take a look into the following examples: * {{{./examples/classpaths.html}Referencing the Maven Classpaths}} * {{{./examples/tasksAttributes.html}Using <<<\>>> Attributes}} * {{{./examples/customTasks.html}Using tasks not included in Ant's default jar}} [] maven-antrun-plugin-1.7/src/site/apt/examples/0000755000175000017500000000000012147706601020761 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/site/apt/examples/classpaths.apt.vm0000644000175000017500000001202711475005012024246 0ustar ebourgebourg ------ Using the classpaths ------ Carlos Sanchez, Franz Allan Valencia See ------ 27 July 2006 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Referencing the Maven Classpaths A property is set in the Ant build for each project dependency. Each property name uses the format <>. For example, to show the path to a jar dependency with groupId "org.apache" and artifactId "common-util", the following could be used. ------ #set( $D = '$' ) ------ If the dependency includes a classifier, the classifier is appended to the property name. For example, groupId "org.apache", artifactId "common-util", type "jar", and classifier "jdk14". ------ #set( $D = '$' ) ------ <> the old format "maven.dependency.groupId.artifactId[.classifier].type.path" has been deprecated and should no longer be used. You can also use these classpath references: * <<>> * <<>> * <<>> * <<>> For example, to display Maven's classpaths using antrun, we can do this ------ 4.0.0 my-test-app my-test-group 1.0-SNAPSHOT org.apache.maven.plugins maven-antrun-plugin ${project.version} compile compile run ------ or alternatively, we can use an external <<>>. ------ 4.0.0 my-test-app my-test-group 1.0-SNAPSHOT org.apache.maven.plugins maven-antrun-plugin ${project.version} compile compile run ------ The <<>>: ------ ------ maven-antrun-plugin-1.7/src/site/apt/examples/customTasks.apt.vm0000644000175000017500000000551411454110512024423 0ustar ebourgebourg ------ Using tasks not included in Ant's default jar ------ Carlos Sanchez ------ 15 July 2008 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Using tasks not included in Ant's default jar To use Ant tasks not included in the Ant jar, like Ant optional or custom tasks you need to add the dependencies needed for the task to run to the plugin classpath and use the <<>> reference if needed. ------ 4.0.0 my-test-app my-test-group 1.0-SNAPSHOT org.apache.maven.plugins maven-antrun-plugin ${project.version} ftp deploy run commons-net commons-net 1.4.1 org.apache.ant ant-commons-net 1.8.1 ------ maven-antrun-plugin-1.7/src/site/apt/examples/tasksAttributes.apt.vm0000644000175000017500000000371611444231356025312 0ustar ebourgebourg ------ Using tasks attributes ------ Vincent Siveton ------ September 2006 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Using <<<\>>> Attributes Since plugin version 1.2 you can specify attributes in the <<<\>>> configuration to execute or not Ant tasks depending some conditions. For example, to skip Ant call, you could add the following: ------ ... ... org.apache.maven.plugins maven-antrun-plugin ${project.version} run ... ... ------ maven-antrun-plugin-1.7/src/site/apt/usage.apt.vm0000644000175000017500000003165611456567161021421 0ustar ebourgebourg ------ Usage ------ Kenney Westerhof, Franz Allan Valencia See, Vincent Siveton ------ September 2006 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ NOTE: For help with the syntax of this file, see: ~~ http://maven.apache.org/doxia/references/apt-format.html Usage * Run The maven-antrun-plugin has only one goal, <<>>. This allows Maven to run Ant tasks. To do so, there must be an existing project and maven-antrun-plugin must have its <<<\>>> tag configured (although it would still execute without the <<<\>>> tag, it would not do anything). Below is the template for <<>>'s <<>>. ------ [...] maven-antrun-plugin ${project.version} run [...] ------ Moreover, you can add a script to each lifecycle phase, by duplicating the <<<\>>> section and specifying a new phase. Ultimately, you could specify some Ant {{{http://ant.apache.org/manual/using.html#targets}<<<\>>>}} attributes in the <<<\>>> tag. Only <<>> attribute in Ant <<<\>>> is not wrapped. ------ [...] [...] ------ * Additional source directories If your ant tasks generate additional source code that needs to be added to the build, you can use the {{{http://mojo.codehaus.org/build-helper-maven-plugin/}build-helper-maven-plugin}}. The sourceRoot and testSourceRoot options of the antrun plugin have been deprecated. * Using maven properties All of the properties available to maven are also available in the target configuration. However, you may want to call an external Ant build script using the task. To avoid name conflicts, only a subset of the properties are passed to the external Ant build. These include all properties defined in the section of the POM. It also includes prefixed versions of some of the commonly used Maven properties. ------ maven.project.groupId maven.project.artifactId maven.project.name etc. ------ If the maven property you want to use is not available in an external file, you will have to redefine the property before calling . ------ ------ * Ant Expressions to Maven Expressions Mapping Some Ant expressions have their respective counterparts in Maven. Thus, one can simply invoke the corresponding Maven expression instead of using maven-antrun-plugin to avoid the unneccessary overhead. *-----------------------------------+-----------------------------------+ | <> | <> | *-----------------------------------------------------------------------+ | Built-in Tasks | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-antrun-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-antrun-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{http://maven.apache.org/guides/introduction/introduction-to-profiles.html}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{http://maven.apache.org/guides/introduction/introduction-to-profiles.html}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-dependency-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-ear-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | | | | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-jar-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-jar-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-compiler-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-javadoc-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-jar-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | | | | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-war-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-assembly-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ Optional Tasks | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-antlr-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-dependency-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-ejb-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-deploy-plugin/}<<>>}} | | | | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-compiler-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-compiler-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-compiler-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-surefire-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-surefire-report-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-deploy-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-deploy-plugin/}<<>>}} | *-----------------------------------+-----------------------------------+ | <<>> | {{{../maven-resources-plugin/}<<>>}} | | | | *-----------------------------------+-----------------------------------+ maven-antrun-plugin-1.7/src/test/0000755000175000017500000000000012147706601016372 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/test/java/0000755000175000017500000000000012147706601017313 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/test/resources/0000755000175000017500000000000012147706601020404 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/0000755000175000017500000000000012147706601016337 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/0000755000175000017500000000000012147706601017260 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/0000755000175000017500000000000012147706601020047 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/apache/0000755000175000017500000000000012147706601021270 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/apache/maven/0000755000175000017500000000000012147706601022376 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/apache/maven/ant/0000755000175000017500000000000012147706601023160 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/apache/maven/ant/tasks/0000755000175000017500000000000012147706601024305 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/apache/maven/ant/tasks/DependencyFilesetsTask.java0000644000175000017500000001401411401541571031543 0ustar ebourgebourgpackage org.apache.maven.ant.tasks; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.util.LinkedHashSet; import java.util.Iterator; import java.util.Set; import org.apache.maven.ant.tasks.support.SpecificScopesArtifactFilter; import org.apache.maven.ant.tasks.support.TypesArtifactFilter; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; import org.apache.maven.plugin.antrun.AntRunMojo; import org.apache.maven.project.MavenProject; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; /** * Ant task which create a fileset for each dependency in a Maven project, and a * fileset containing all selected dependencies. * * @author pgier */ public class DependencyFilesetsTask extends Task { public final static String DEFAULT_PROJECT_DEPENDENCIES_ID = "maven.project.dependencies"; /** * The project ref Id of the project being used. */ private String mavenProjectId = AntRunMojo.DEFAULT_MAVEN_PROJECT_REFID; /** * The id to store the dependencies fileset. */ private String projectDependenciesId = DEFAULT_PROJECT_DEPENDENCIES_ID; public String getProjectDependenciesId() { return projectDependenciesId; } public void setProjectDependenciesId( String projectDependenciesId ) { this.projectDependenciesId = projectDependenciesId; } /** * The string to prepend to all dependency filesets. */ private String prefix = ""; /** * A comma separated list of artifact types to include. */ private String types = ""; /** * A comma separated list of dependency scopes to include. */ private String scopes = ""; public DependencyFilesetsTask() { } public void execute() { if ( this.getProject().getReference( mavenProjectId ) == null ) { throw new BuildException( "Maven project reference not found: " + mavenProjectId ); } MavenProject mavenProject = (MavenProject) this.getProject().getReference( "maven.project" ); // Add filesets for depenedency artifacts Set depArtifacts = filterArtifacts( mavenProject.getArtifacts() ); FileSet dependenciesFileSet = new FileSet(); dependenciesFileSet.setProject( getProject() ); ArtifactRepository localRepository = (ArtifactRepository) getProject().getReference( "maven.local.repository" ); dependenciesFileSet.setDir( new File( localRepository.getBasedir() ) ); for ( Iterator it = depArtifacts.iterator(); it.hasNext(); ) { Artifact artifact = (Artifact) it.next(); String relativeArtifactPath = localRepository.pathOf( artifact ); dependenciesFileSet.createInclude().setName( relativeArtifactPath ); String fileSetName = getPrefix() + artifact.getDependencyConflictId(); FileSet singleArtifactFileSet = new FileSet(); singleArtifactFileSet.setProject( getProject() ); singleArtifactFileSet.setFile( artifact.getFile() ); getProject().addReference( fileSetName, singleArtifactFileSet ); } getProject().addReference( ( getPrefix() + projectDependenciesId ), dependenciesFileSet ); } public String getMavenProjectId() { return mavenProjectId; } public void setMavenProjectId( String mavenProjectId ) { this.mavenProjectId = mavenProjectId; } public String getPrefix() { if ( prefix == null ) { prefix = ""; } return prefix; } /** * Prefix to be added to each of the dependency filesets. Default is empty string. */ public void setPrefix( String prefix ) { this.prefix = prefix; } public String getTypes() { return types; } public void setTypes( String types ) { this.types = types; } public String getScopes() { return scopes; } public void setScopes( String scopes ) { this.scopes = scopes; } /** * Filter a set of artifacts using the scopes and type filters. * * @param artifacts * @return */ public Set filterArtifacts( Set artifacts ) { if ( scopes == null ) { scopes = ""; } if ( types == null ) { types = ""; } if ( scopes.equals( "" ) && types.equals( "" ) ) { return artifacts; } AndArtifactFilter filter = new AndArtifactFilter(); if ( !scopes.equals( "" ) ) { filter.add( new SpecificScopesArtifactFilter( getScopes() ) ); } if ( !types.equals( "" ) ) { filter.add( new TypesArtifactFilter( getTypes() ) ); } Set artifactsResult = new LinkedHashSet(); for ( Iterator iter = artifacts.iterator(); iter.hasNext(); ) { Artifact artifact = (Artifact) iter.next(); if ( filter.include( artifact ) ) { artifactsResult.add( artifact ); } } return artifactsResult; } } maven-antrun-plugin-1.7/src/main/java/org/apache/maven/ant/tasks/support/0000755000175000017500000000000012147706601026021 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/apache/maven/ant/tasks/support/TypesArtifactFilter.java0000644000175000017500000000352211350722655032620 0ustar ebourgebourgpackage org.apache.maven.ant.tasks.support; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import java.util.ArrayList; import java.util.List; /** * Artifact Filter which filters on artifact types. * */ public class TypesArtifactFilter implements ArtifactFilter { private List types = new ArrayList(); /** * Accepts a comma separated list of types * * @param types */ public TypesArtifactFilter( String types ) { if ( !types.trim().equals( "" ) ) { String[] typesArray = types.split( "," ); for ( int i = 0; i < typesArray.length; ++i ) { this.types.add( typesArray[i].trim() ); } } } public boolean include( Artifact artifact ) { String artifactType = artifact.getType(); if ( artifactType == null || artifactType.equals( "" ) ) { artifactType = "jar"; } return types.contains( artifactType ); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootmaven-antrun-plugin-1.7/src/main/java/org/apache/maven/ant/tasks/support/SpecificScopesArtifactFilter.javamaven-antrun-plugin-1.7/src/main/java/org/apache/maven/ant/tasks/support/SpecificScopesArtifactFilte0000644000175000017500000000624011350722655033314 0ustar ebourgebourgpackage org.apache.maven.ant.tasks.support; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; /** * Filter to only retain objects in the given scope(s). * * @author pgier * @version $Id: SpecificScopesArtifactFilter.java 925310 2010-03-19 16:26:21Z pgier $ */ public class SpecificScopesArtifactFilter implements ArtifactFilter { private boolean compileScope; private boolean runtimeScope; private boolean testScope; private boolean providedScope; private boolean systemScope; /** * Takes a comma separated list of scopes to include. * * @param scopes A comma separated list of scopes */ public SpecificScopesArtifactFilter( String scopes ) { String [] scopeList = scopes.split( "," ); for ( int i=0; iHerve Boutemy * @version $Id: VersionMapper.java 947173 2010-05-21 21:04:32Z pgier $ */ public class VersionMapper implements FileNameMapper, Comparator { private List versions; private String to; public String[] mapFileName( String sourceFileName ) { String originalFileName = new File( sourceFileName ).getName(); for ( Iterator iter = versions.iterator(); iter.hasNext(); ) { String version = (String) iter.next(); int index = originalFileName.indexOf( version ); if ( index >= 0 ) { // remove version in artifactId-version(-classifier).type String baseFilename = originalFileName.substring( 0, index - 1 ); String extension = originalFileName.substring( index + version.length() ); String path = sourceFileName.substring( 0, sourceFileName.length() - originalFileName.length() ); if ( "flatten".equals( to ) ) { path = ""; } return new String[] { path + baseFilename + extension }; } } return new String[] { sourceFileName }; } /** * Set the versions identifiers that this mapper can remove from filenames. The separator value used is path * separator, as used by dependencies task when setting versionsId property value. */ public void setFrom( String from ) { String[] split = StringUtils.split( from, File.pathSeparator ); // sort, from lengthiest to smallest Arrays.sort( split, this ); versions = Arrays.asList( split ); } /** * By default, only filename is changed, but if this attribute is set to flatten, directory is removed. */ public void setTo( String to ) { this.to = to; } public int compare( Object o1, Object o2 ) { String s1 = (String) o1; String s2 = (String) o2; int lengthDiff = s2.length() - s1.length(); return ( lengthDiff != 0 ) ? lengthDiff : s1.compareTo( s2 ); } } maven-antrun-plugin-1.7/src/main/java/org/apache/maven/ant/tasks/AttachArtifactTask.java0000644000175000017500000000716511451430076030663 0ustar ebourgebourgpackage org.apache.maven.ant.tasks; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import org.apache.maven.plugin.antrun.AntRunMojo; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; import org.codehaus.plexus.util.FileUtils; public class AttachArtifactTask extends Task { /** * The refId of the maven project. */ private String mavenProjectRefId = AntRunMojo.DEFAULT_MAVEN_PROJECT_REFID; /** * The refId of the maven project helper component. */ private String mavenProjectHelperRefId = AntRunMojo.DEFAULT_MAVEN_PROJECT_HELPER_REFID; /** * The file to attach. */ private File file; /** * The classifier of the artifact to attach */ private String classifier; /** * The type of the artifact to attach. Defaults to file extension. */ private String type; public void execute() { if ( file == null ) { throw new BuildException( "File is a required parameter." ); } if ( !file.exists() ) { throw new BuildException( "File does not exist: " + file ); } if ( this.getProject().getReference( mavenProjectRefId ) == null ) { throw new BuildException( "Maven project reference not found: " + mavenProjectRefId ); } if ( type == null ) { type = FileUtils.getExtension( file.getName() ); } MavenProject mavenProject = (MavenProject) this.getProject().getReference( mavenProjectRefId ); if ( this.getProject().getReference( mavenProjectHelperRefId ) == null ) { throw new BuildException( "Maven project helper reference not found: " + mavenProjectHelperRefId ); } log( "Attaching " + file + " as an attached artifact", Project.MSG_VERBOSE ); MavenProjectHelper projectHelper = (MavenProjectHelper) getProject().getReference( mavenProjectHelperRefId ); projectHelper.attachArtifact( mavenProject, type, classifier, file ); } public File getFile() { return file; } public void setFile( File file ) { this.file = file; } public String getMavenProjectRefId() { return mavenProjectRefId; } public void setMavenProjectRefId( String mavenProjectRefId ) { this.mavenProjectRefId = mavenProjectRefId; } public String getClassifier() { return classifier; } public void setClassifier( String classifier ) { this.classifier = classifier; } public String getType() { return type; } public void setType( String type ) { this.type = type; } } maven-antrun-plugin-1.7/src/main/java/org/apache/maven/plugin/0000755000175000017500000000000012147706601023674 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/apache/maven/plugin/antrun/0000755000175000017500000000000012147706601025203 5ustar ebourgebourgmaven-antrun-plugin-1.7/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java0000644000175000017500000005743311652601057030115 0ustar ebourgebourgpackage org.apache.maven.plugin.antrun; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.io.File; import java.io.IOException; import java.io.LineNumberReader; import java.io.StringWriter; import java.util.ArrayList; import java.util.Collection; import java.util.Hashtable; import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DefaultLogger; import org.apache.tools.ant.Project; import org.apache.tools.ant.ProjectHelper; import org.apache.tools.ant.taskdefs.Typedef; import org.apache.tools.ant.types.Path; import org.codehaus.plexus.configuration.PlexusConfiguration; import org.codehaus.plexus.configuration.PlexusConfigurationException; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.ReaderFactory; import org.codehaus.plexus.util.StringUtils; /** * Maven AntRun Mojo. *
* This plugin provides the capability of calling Ant tasks * from a POM by running the nested ant tasks inside the <tasks/> * parameter. It is encouraged to move the actual tasks to * a separate build.xml file and call that file with an * <ant/> task. * * @author Kenney Westerhof * @author Vincent Siveton * @version $Id: AntRunMojo.java 1190514 2011-10-28 19:27:43Z bimargulies $ * @goal run * @threadSafe * @requiresDependencyResolution test */ public class AntRunMojo extends AbstractMojo { /** * The refid used to store the Maven project object in the Ant build. */ public final static String DEFAULT_MAVEN_PROJECT_REFID = "maven.project"; /** * The refid used to store the Maven project object in the Ant build. */ public final static String DEFAULT_MAVEN_PROJECT_HELPER_REFID = "maven.project.helper"; /** * The default target name. */ public final static String DEFAULT_ANT_TARGET_NAME = "main"; /** * The default encoding to use for the generated Ant build. */ public final static String UTF_8 = "UTF-8"; /** * The name used for the ant target */ private String antTargetName; /** * The path to The XML file containing the definition of the Maven tasks. */ public final static String ANTLIB = "org/apache/maven/ant/tasks/antlib.xml"; /** * The URI which defines the built in Ant tasks */ public final static String TASK_URI = "antlib:org.apache.maven.ant.tasks"; /** * The Maven project object * * @parameter expression="${project}" * @readonly */ private MavenProject project; /** * The Maven project helper object * * @component */ private MavenProjectHelper projectHelper; /** * The plugin dependencies. * * @parameter expression="${plugin.artifacts}" * @required * @readonly */ private List pluginArtifacts; /** * The local Maven repository * * @parameter expression="${localRepository}" * @readonly */ protected ArtifactRepository localRepository; /** * String to prepend to project and dependency property names. * * @parameter default-value="" * @since 1.4 */ private String propertyPrefix; /** * The xml tag prefix to use for the built in Ant tasks. This prefix needs to be prepended to each task referenced * in the antrun target config. For example, a prefix of "mvn" means that the attachartifact task is referenced by * "<mvn:attachartifact>" The default value of an empty string means that no prefix is used for the tasks. * * @parameter default-value="" * @since 1.5 */ private String customTaskPrefix = ""; /** * The name of a property containing the list of all dependency versions. This is used for the removing the versions * from the filenames. * * @parameter default-value="maven.project.dependencies.versions" */ private String versionsPropertyName; /** * The XML for the Ant task. You can add anything you can add between <target> and </target> in a * build.xml. * * @deprecated Use target instead * @parameter */ private PlexusConfiguration tasks; /** * The XML for the Ant target. You can add anything you can add between <target> and </target> in a * build.xml. * * @parameter * @since 1.5 */ private PlexusConfiguration target; /** * This folder is added to the list of those folders containing source to be compiled. Use this if your ant script * generates source code. * * @parameter expression="${sourceRoot}" * @deprecated Use the build-helper-maven-plugin to bind source directories */ private File sourceRoot; /** * This folder is added to the list of those folders containing source to be compiled for testing. Use this if your * ant script generates test source code. * * @parameter expression="${testSourceRoot}" * @deprecated Use the build-helper-maven-plugin to bind test source directories */ private File testSourceRoot; /** * Specifies whether the Antrun execution should be skipped. * * @parameter expression="${maven.antrun.skip}" default-value="false" * @since 1.7 */ private boolean skip; /** * Specifies whether the Ant properties should be propagated to the Maven properties. * * @parameter default-value="false" * @since 1.7 */ private boolean exportAntProperties; /** * Specifies whether a failure in the ant build leads to a failure of the Maven build. * * If this value is 'true', the Maven build will proceed even if the ant build fails. * If it is 'false', then the Maven build fails if the ant build fails. * * @parameter default-value="true" * @since 1.7 */ private boolean failOnError; /** * @see org.apache.maven.plugin.Mojo#execute() */ public void execute() throws MojoExecutionException { if ( skip ) { getLog().info( "Skipping Antrun execution" ); return; } MavenProject mavenProject = getMavenProject(); if ( tasks != null ) { getLog().warn( "Parameter tasks is deprecated, use target instead" ); target = tasks; } if ( target == null ) { getLog().info( "No ant target defined - SKIPPED" ); return; } if ( propertyPrefix == null ) { propertyPrefix = ""; } try { Project antProject = new Project(); File antBuildFile = this.writeTargetToProjectFile( ); ProjectHelper.configureProject( antProject, antBuildFile ); antProject.init(); DefaultLogger antLogger = new DefaultLogger(); antLogger.setOutputPrintStream( System.out ); antLogger.setErrorPrintStream( System.err ); if ( getLog().isDebugEnabled() ) { antLogger.setMessageOutputLevel( Project.MSG_DEBUG ); } else if ( getLog().isInfoEnabled() ) { antLogger.setMessageOutputLevel( Project.MSG_INFO ); } else if ( getLog().isWarnEnabled() ) { antLogger.setMessageOutputLevel( Project.MSG_WARN ); } else if ( getLog().isErrorEnabled() ) { antLogger.setMessageOutputLevel( Project.MSG_ERR ); } else { antLogger.setMessageOutputLevel( Project.MSG_VERBOSE ); } antProject.addBuildListener( antLogger ); antProject.setBaseDir( mavenProject.getBasedir() ); Path p = new Path( antProject ); p.setPath( StringUtils.join( mavenProject.getCompileClasspathElements().iterator(), File.pathSeparator ) ); /* maven.dependency.classpath it's deprecated as it's equal to maven.compile.classpath */ antProject.addReference( "maven.dependency.classpath", p ); antProject.addReference( "maven.compile.classpath", p ); p = new Path( antProject ); p.setPath( StringUtils.join( mavenProject.getRuntimeClasspathElements().iterator(), File.pathSeparator ) ); antProject.addReference( "maven.runtime.classpath", p ); p = new Path( antProject ); p.setPath( StringUtils.join( mavenProject.getTestClasspathElements().iterator(), File.pathSeparator ) ); antProject.addReference( "maven.test.classpath", p ); /* set maven.plugin.classpath with plugin dependencies */ antProject.addReference( "maven.plugin.classpath", getPathFromArtifacts( pluginArtifacts, antProject ) ); antProject.addReference( DEFAULT_MAVEN_PROJECT_REFID, getMavenProject() ); antProject.addReference( DEFAULT_MAVEN_PROJECT_HELPER_REFID, projectHelper ); antProject.addReference( "maven.local.repository", localRepository ); initMavenTasks( antProject ); // The ant project needs actual properties vs. using expression evaluator when calling an external build // file. copyProperties( mavenProject, antProject ); if ( getLog().isInfoEnabled() ) { getLog().info( "Executing tasks" ); } antProject.executeTarget( antTargetName ); if ( getLog().isInfoEnabled() ) { getLog().info( "Executed tasks" ); } copyProperties( antProject, mavenProject ); } catch ( DependencyResolutionRequiredException e ) { throw new MojoExecutionException( "DependencyResolutionRequiredException: " + e.getMessage(), e ); } catch ( BuildException e ) { StringBuffer sb = new StringBuffer(); sb.append( "An Ant BuildException has occured: " + e.getMessage() ); String fragment = findFragment( e ); if ( fragment != null ) { sb.append( "\n" ).append( fragment ); } if ( !failOnError ) { getLog().info( sb.toString(), e ); return; // do not register roots. } else { throw new MojoExecutionException( sb.toString(), e ); } } catch ( Throwable e ) { throw new MojoExecutionException( "Error executing ant tasks: " + e.getMessage(), e ); } if ( sourceRoot != null ) { getLog().info( "Registering compile source root " + sourceRoot ); getMavenProject().addCompileSourceRoot( sourceRoot.toString() ); } if ( testSourceRoot != null ) { getLog().info( "Registering compile test source root " + testSourceRoot ); getMavenProject().addTestCompileSourceRoot( testSourceRoot.toString() ); } } /** * @param artifacts * @param antProject * @return a path * @throws DependencyResolutionRequiredException */ public Path getPathFromArtifacts( Collection artifacts, Project antProject ) throws DependencyResolutionRequiredException { if ( artifacts == null ) { return new Path( antProject ); } List list = new ArrayList( artifacts.size() ); for ( Iterator i = artifacts.iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); File file = a.getFile(); if ( file == null ) { throw new DependencyResolutionRequiredException( a ); } list.add( file.getPath() ); } Path p = new Path( antProject ); p.setPath( StringUtils.join( list.iterator(), File.pathSeparator ) ); return p; } /** * Copy properties from the maven project to the ant project. * * @param mavenProject * @param antProject */ public void copyProperties( MavenProject mavenProject, Project antProject ) { Properties mavenProps = mavenProject.getProperties(); Iterator iter = mavenProps.keySet().iterator(); while ( iter.hasNext() ) { String key = (String) iter.next(); antProject.setProperty( key, mavenProps.getProperty( key ) ); } // Set the POM file as the ant.file for the tasks run directly in Maven. antProject.setProperty( "ant.file", mavenProject.getFile().getAbsolutePath() ); // Add some of the common maven properties getLog().debug("Setting properties with prefix: " + propertyPrefix ); antProject.setProperty( ( propertyPrefix + "project.groupId" ), mavenProject.getGroupId() ); antProject.setProperty( ( propertyPrefix + "project.artifactId" ), mavenProject.getArtifactId() ); antProject.setProperty( ( propertyPrefix + "project.name" ), mavenProject.getName() ); if ( mavenProject.getDescription() != null) { antProject.setProperty( ( propertyPrefix + "project.description" ), mavenProject.getDescription() ); } antProject.setProperty( ( propertyPrefix + "project.version" ), mavenProject.getVersion() ); antProject.setProperty( ( propertyPrefix + "project.packaging" ), mavenProject.getPackaging() ); antProject.setProperty( ( propertyPrefix + "project.build.directory" ), mavenProject.getBuild().getDirectory() ); antProject.setProperty( ( propertyPrefix + "project.build.outputDirectory" ), mavenProject.getBuild().getOutputDirectory() ); antProject.setProperty( ( propertyPrefix + "project.build.testOutputDirectory" ), mavenProject.getBuild().getTestOutputDirectory() ); antProject.setProperty( ( propertyPrefix + "project.build.sourceDirectory" ), mavenProject.getBuild().getSourceDirectory() ); antProject.setProperty( ( propertyPrefix + "project.build.testSourceDirectory" ), mavenProject.getBuild().getTestSourceDirectory() ); antProject.setProperty( ( propertyPrefix + "localRepository" ), localRepository.toString() ); antProject.setProperty( ( propertyPrefix + "settings.localRepository" ), localRepository.getBasedir() ); // Add properties for depenedency artifacts Set depArtifacts = mavenProject.getArtifacts(); for ( Iterator it = depArtifacts.iterator(); it.hasNext(); ) { Artifact artifact = (Artifact) it.next(); String propName = artifact.getDependencyConflictId(); antProject.setProperty( propertyPrefix + propName, artifact.getFile().getPath() ); } // Add a property containing the list of versions for the mapper StringBuffer versionsBuffer = new StringBuffer(); for ( Iterator it = depArtifacts.iterator(); it.hasNext(); ) { Artifact artifact = (Artifact) it.next(); versionsBuffer.append( artifact.getVersion() + File.pathSeparator ); } antProject.setProperty( versionsPropertyName, versionsBuffer.toString() ); // Add properties in deprecated format to depenedency artifacts // This should be removed in future versions of the antrun plugin. for ( Iterator it = depArtifacts.iterator(); it.hasNext(); ) { Artifact artifact = (Artifact) it.next(); String propName = getDependencyArtifactPropertyName( artifact ); antProject.setProperty( propName, artifact.getFile().getPath() ); } } /** * Copy properties from the ant project to the maven project. * * @param antProject not null * @param mavenProject not null * @since 1.7 */ public void copyProperties( Project antProject, MavenProject mavenProject ) { if ( !exportAntProperties ) { return; } getLog().debug( "Propagated Ant properties to Maven properties" ); Hashtable antProps = antProject.getProperties(); Iterator iter = antProps.keySet().iterator(); while ( iter.hasNext() ) { String key = (String) iter.next(); Properties mavenProperties = mavenProject.getProperties(); if ( mavenProperties.getProperty( key ) != null ) { getLog().debug( "Ant property '" + key +"=" +mavenProperties.getProperty( key ) + "' clashs with an existing Maven property, SKIPPING this Ant property propagation." ); continue; } mavenProperties.setProperty( key, antProps.get( key ).toString() ); } } /** * Prefix for legacy property format. * @deprecated This should only be used for generating the old property format. */ public static final String DEPENDENCY_PREFIX = "maven.dependency."; /** * Returns a property name for a dependency artifact. The name is in the format * maven.dependency.groupId.artifactId[.classifier].type.path * * @param artifact * @return property name * @deprecated The dependency conflict ID should be used as the property name. */ public static String getDependencyArtifactPropertyName( Artifact artifact ) { String key = DEPENDENCY_PREFIX + artifact.getGroupId() + "." + artifact.getArtifactId() + ( artifact.getClassifier() != null ? "." + artifact.getClassifier() : "" ) + ( artifact.getType() != null ? "." + artifact.getType() : "" ) + ".path"; return key; } /** * Get the current Maven project * * @return current Maven project */ public MavenProject getMavenProject() { return this.project; } public void initMavenTasks( Project antProject ) { getLog().debug( "Initialize Maven Ant Tasks" ); Typedef typedef = new Typedef(); typedef.setProject( antProject ); typedef.setResource( ANTLIB ); if ( ! customTaskPrefix.equals( "" ) ) { typedef.setURI( TASK_URI ); } typedef.execute(); } /** * Write the ant target and surrounding tags to a temporary file * * @throws PlexusConfigurationException */ private File writeTargetToProjectFile() throws IOException, PlexusConfigurationException { // Have to use an XML writer because in Maven 2.x the PlexusConfig toString() method loses XML attributes StringWriter writer = new StringWriter(); AntrunXmlPlexusConfigurationWriter xmlWriter = new AntrunXmlPlexusConfigurationWriter(); xmlWriter.write( target, writer ); StringBuffer antProjectConfig = writer.getBuffer(); // replace deprecated tasks tag with standard Ant target stringReplace( antProjectConfig, "\n"; antProjectConfig.insert( 0, xmlHeader ); final String projectOpen = "\n"; int index = antProjectConfig.indexOf( "