You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/12/20 09:27:09 UTC
[maven-ant-plugin] annotated tag maven-ant-plugin-2.1 created (now
a402fd8)
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a change to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git.
at a402fd8 (tag)
tagging b54a97401cb01c6135c74ae30b435f76bf64146a (commit)
by Vincent Siveton
on Tue May 20 02:02:22 2008 +0000
- Log -----------------------------------------------------------------
maven-ant-plugin-2.1
-----------------------------------------------------------------------
This annotated tag includes the following new commits:
new de74b97 ant plugin imported
new cbc0e73 use released versions
new 5ff024a bump versions
new 6f8c86a update parent references to get access to the ci settings
new d30b5ac Resolving: MNG-495
new b4f3299 Update all versions to beta-1-SNAPSHOT
new 5df8fc1 Fix svn properties
new 6b833b9 PR: MNG-596 add XSD definition to m2 poms and archetypes
new a8f21e6 add todir on batchtest to save reports
new 0854e01 update dependency and parent versions
new 1daea99 [maven-release-plugin] prepare release maven-ant-2.0-beta-1
new c094bb5 [maven-release-plugin] prepare for next development iteration
new dbf6570 ignore release.properties and more
new 75e9ec9 PR: MNG-749 Submitted by: Edwin Punzalan Reviewed by: Brett Porter make directories in ant plugin for repository files
new 6b8f42b remove unneeded exception in ant plugin
new ca08739 clean up ant plugin exception handling
new cde45f5 update versions in plugins
new 6c584c8 ignore
new 72947a5 move plugins
new c0bafd6 adjust parent POMs
new ac317f9 remove release.properties from ignores
new e93a903 MNG-2460: Incorrect POM inheritance for plugins
new 411da8e MANT-5: Add line breaks between <target> elements in build.xml
new b2e67ec MANT-2: error "maven.repo.local" property in the ant file
new 112f204 MANT-10: error with build.classpath in build.xml
new 3e8b91f MANT-14: Generate a build-user.xml à la Eclipse
new cf39c52 MANT-15: Review plugin documentation
new 9bb06a8 MANT-16: Create an clean goal
new 8c04ed3 MANT-13: Generated build.xml for pom packaged super projects doesn't invoke subprojects
new 5417ffe MANT-17: Using Maven Compiler Plugin settings to define javac task
new 68adbe6 MANT-18: added Maven Project properties in the maven-build.properties
new eac24a7 o Updated prerequisite to 2.0.2 and updated dependencies o Tested install with Maven 2.0.2, 2.0.3 and 2.0.4
new a2d1cba MANT-19: Handle more packaging projects (jar, ear, war...)
new c3f7111 use inheritence and make all the site appearances consistent
new f8c0ff1 put back the Overview menu - when you inherit menu items they are meant to be resolved against the parent, by design - so these always belonged in the child POM.
new 86ebffe o updating to latest release parent
new 1e05a11 o updating to latest released parent
new 5a29642 - move plugin-plugin out of 'reporting' for plugins. It's a required part of the site, and does not cause any issues with the reactor or site generation - update to snapshots
new 6441830 o applied new license headers o no code changes
new 9bd2a8b MANT-24:Generate synonum targets named after the archive type for the package target Submitted by: Petteri Räty Reviewed by: Vincent Siveton
new 117b5ae MANT-23: Make the ant plugin able to generate javadoc targets into build.xml files
new c35ef83 o ignored files
new 223cbc4 Update parent version to 8, as 8-SNAPSHOT is never deployed and 8 is released
new 7eec345 MANT-27: updated pom to declare used dependencies
new 602c93f git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@522032 13f79535-47bb-0310-9956-ffa450edef68
new 6cf6feb Add two common variables, project.build.outputDirectory and project.build.directory
new 8ad5bda Set version to 2.0
new 6f741f7 o remove tab o improved doc
new c51b816 Use released version of install plugin
new f63e260 [maven-release-plugin] prepare release maven-ant-plugin-2.0
new 916183c [maven-release-plugin] prepare for next development iteration
new abe9e70 Readd license header lost in release
new 8c2b795 o fixed IT builds with snapshot version
new 46ed54c o forced IT o added repo1 for IT test
new 8cdef31 o set surefire version to try to avoid CI build failures
new 6f5c36d o forced download to try to avoid CI build failures
new 486e215 add more info to find out why it is failing on Solaris
new 16d35b3 forgot IOException doesn't take this arg even in JDK 1.4+. Going with a temporary solution.
new daf94c9 work around bug in old versions of xalan bundled in JDK 1.4.2
new 7898ccb o Improve documentation.
new 8884f29 [MANT-35] The generated maven-build.xml has paths that contain \ characters on Windows
new 207d70f [MANT-34] The generated maven-build.xml and maven-build.properties contains absolute path to local repository
new 719d598 [MANT-30] classcast exception when running ant:ant on tagtraum.com's gcviewer project Submitted by: Patrick Huber Reviewed by: Dennis Lundberg
new c74a8ef o Ignore IDEA files.
new 7a39f78 o Added svn:eol-style=native
new df06a09 o Fixed svn:keywords
new 228327b [MANT-37] Wrong path to test resources in maven-build.xml
new 43be787 [MANT-36] Use correct file encoding when writing build files
new 6ce6835 o Enabled filtering of plugin version for IT POM
new e6419cd o Decoupled unit tests from default encoding of executing JVM for build reproducibility
new 455efd9 o Added bin to svn:ignore
new 9699143 [MANT-32] java.lang.ClassCastException when packaging jeuclid-3.0.1
new d1d0ed4 [MANT-34] The generated maven-build.xml and maven-build.properties contains absolute path to local repository
new a7787a4 o Adjusted IT due to r639886
new d60798d [MANT-4] Generated ANT contains hardcoded "get" tasks that look at the "C:\" drive etc... when using a local repository
new e2c0191 [MANT-38] Use reporting output directory configured in POM
new dd26960 [MANT-39] Always specify source/target options for javac
new ef4a011 [MANT-40] Use includes/excludes configured for Surefire when running tests
new 732a9f9 [MANT-7] "test" target should support running a single test - just like mvn test does
new 3d291cd [MANT-6] "test" targets should fail if junit.jar not present
new f556e04 o Added some line breaks to the build scripts
new 92154ac o Stabilized ITs
new 5ad0930 [MANT-22] Make it possible to run the package target without tests
new 6e85328 o Fixed docs
new 44e3e06 o Bumped to latest parent
new 31cbe99 encoding-it should not fail if platform encoding does not support tested characters
new 2fde0f5 o updated prerequisite to Maven 2.0.6 since plexus-utils version is > 1.1 o upgraded plexus-utils to 1.5.1 to support spaces in dir name
new 6fe01f4 o Decoupled IT from file system for more robustness
new a5dedc8 o Moved the IT verification into the invoker controlled builds for better failure analysis
new 61573d3 o Updated to maven-plugins:11
new 6e58094 o Avoided usage of StringInputStream/StringOutputStream with regard to PLXUTILS-70
new f95a550 o Updated to wagon-provider-api:1.0-beta-2
new a2d362c o Update links to Doxia APT reference.
new b6ed9e0 o lock down plugins for it
new 268ee76 o readingness pom o bumped to maven-surefire-plugin:2.4.3
new 9fd9fda o ignored Eclipse settings
new b54a974 [maven-release-plugin] copy for tag maven-ant-plugin-2.1
The 97 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <co...@maven.apache.org>'].
[maven-ant-plugin] 20/48: o Enabled filtering of plugin version for
IT POM
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 6ce68359b109af046b16519fc62b27ec0d1deadc
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 16:30:09 2008 +0000
o Enabled filtering of plugin version for IT POM
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639699 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/encoding-it/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/it/encoding-it/pom.xml b/src/it/encoding-it/pom.xml
index 5a1afc4..fcfb7f1 100644
--- a/src/it/encoding-it/pom.xml
+++ b/src/it/encoding-it/pom.xml
@@ -15,7 +15,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ant-plugin</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>@pom.version@</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 38/48: o updated prerequisite to Maven 2.0.6
since plexus-utils version is > 1.1 o upgraded plexus-utils to 1.5.1 to
support spaces in dir name
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 2fde0f50c4803814a7e1b3af20d97ff647ace2df
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Sat Apr 5 13:45:27 2008 +0000
o updated prerequisite to Maven 2.0.6 since plexus-utils version is > 1.1
o upgraded plexus-utils to 1.5.1 to support spaces in dir name
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@645098 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 37f78c5..913707c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@ under the License.
<name>Maven Ant Plugin</name>
<version>2.1-SNAPSHOT</version>
<prerequisites>
- <maven>2.0.4</maven>
+ <maven>2.0.6</maven>
</prerequisites>
<issueManagement>
<system>jira</system>
@@ -74,7 +74,7 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>1.4.1</version>
+ <version>1.5.1</version>
</dependency>
<dependency>
<groupId>ant</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 04/48: o fixed IT builds with snapshot version
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 8c2b795e93875bb19e9ef617cb810e94599833e0
Author: Vincent Siveton <vs...@apache.org>
AuthorDate: Wed Aug 22 12:44:36 2007 +0000
o fixed IT builds with snapshot version
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@568593 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/ear-it/pom.xml | 2 +-
src/it/plugin-it/pom.xml | 2 +-
src/it/webapp-it/pom.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/it/ear-it/pom.xml b/src/it/ear-it/pom.xml
index be29397..a7c99b8 100644
--- a/src/it/ear-it/pom.xml
+++ b/src/it/ear-it/pom.xml
@@ -76,7 +76,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ant-plugin</artifactId>
- <version>2.0-beta-2-SNAPSHOT</version>
+ <version>2.1-SNAPSHOT</version>
</plugin>
</plugins>
<pluginManagement>
diff --git a/src/it/plugin-it/pom.xml b/src/it/plugin-it/pom.xml
index 9cf6b8e..e883aae 100644
--- a/src/it/plugin-it/pom.xml
+++ b/src/it/plugin-it/pom.xml
@@ -76,7 +76,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ant-plugin</artifactId>
- <version>2.0-beta-2-SNAPSHOT</version>
+ <version>2.1-SNAPSHOT</version>
</plugin>
</plugins>
</build>
diff --git a/src/it/webapp-it/pom.xml b/src/it/webapp-it/pom.xml
index 1245733..5b3558b 100644
--- a/src/it/webapp-it/pom.xml
+++ b/src/it/webapp-it/pom.xml
@@ -80,7 +80,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ant-plugin</artifactId>
- <version>2.0-beta-2-SNAPSHOT</version>
+ <version>2.1-SNAPSHOT</version>
</plugin>
</plugins>
</build>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 41/48: o Updated to maven-plugins:11
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 61573d36e989dbbf180d8c7d6a043e53915e899b
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Apr 11 21:35:50 2008 +0000
o Updated to maven-plugins:11
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@647324 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 581b7dd..17ebbe6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
- <version>10</version>
+ <version>11</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-ant-plugin</artifactId>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 39/48: o Decoupled IT from file system for more
robustness
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 6fe01f4f12c4c547920dc7e8af0fd59214c7f2ab
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Apr 5 16:25:02 2008 +0000
o Decoupled IT from file system for more robustness
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@645130 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/encoding-it/pom.xml | 6 ++++--
src/it/encoding-it/verify.bsh | 40 +++++++++++++---------------------------
2 files changed, 17 insertions(+), 29 deletions(-)
diff --git a/src/it/encoding-it/pom.xml b/src/it/encoding-it/pom.xml
index 5ea8cd6..dd40abf 100644
--- a/src/it/encoding-it/pom.xml
+++ b/src/it/encoding-it/pom.xml
@@ -9,8 +9,6 @@
<version>1.0-SNAPSHOT</version>
<build>
- <!-- some non-ascii characters here -->
- <finalName>encoding-it-äöüß</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -48,5 +46,9 @@
</plugin>
</plugins>
</build>
+ <reporting>
+ <!-- some non-ascii characters here -->
+ <outputDirectory>target/site-äİΣא۞</outputDirectory>
+ </reporting>
</project>
diff --git a/src/it/encoding-it/verify.bsh b/src/it/encoding-it/verify.bsh
index a12e1f0..cca34e8 100644
--- a/src/it/encoding-it/verify.bsh
+++ b/src/it/encoding-it/verify.bsh
@@ -1,37 +1,23 @@
import java.io.*;
import java.util.*;
+import java.util.regex.*;
+
+import org.codehaus.plexus.util.*;
try
{
- File targetDir = new File( basedir, "target" );
- File[] files = targetDir.listFiles();
- for ( int i = 0; i < files.length; i++ )
+ File buildFile = new File( basedir, "maven-build.xml" );
+ String xml = FileUtils.fileRead( buildFile, "UTF-8" );
+
+ Matcher matcher = Pattern.compile( "value\\s*=\\s*\"\\$\\{maven.build.dir\\}/site-([^\"]+)\"" ).matcher( xml );
+ matcher.find();
+ String chars = matcher.group( 1 );
+
+ if ( !"\u00E4\u0130\u03A3\u05D0\u06DE".equals( chars ) )
{
- File file = files[i];
- if ( file.getName().toLowerCase( Locale.ENGLISH ).endsWith( ".jar" ) )
- {
- if ( file.getName().indexOf( '?' ) >= 0 )
- {
- System.err.println( "JAR file name contains corrupted characters: " + file );
- System.err.println( "Platform encoding: " + System.getProperty( "file.encoding" ) );
- String expected = "\u00E4\u00F6\u00FC\u00DF";
- System.err.println( "expected string with this platform encoding:" + expected );
- String result = new String( expected.getBytes() );
- if ( expected.equals( result ) )
- {
- System.err.println( "Platform encoding supports these characters, filename should not be corrupted." );
- return false;
- }
- else
- {
- System.err.println( "WARN: Platform encoding does not support these characters: filename is corrupted, but cannot determine if it's plugins' fault or not." );
- }
- }
- return true;
- }
+ System.err.println( "Generated build script contains corrupted characters: " + buildFile );
+ return false;
}
- System.err.println( "Could not find generated JAR file" );
- return false;
}
catch( Throwable t )
{
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 46/48: o readingness pom o bumped to
maven-surefire-plugin:2.4.3
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 268ee761fda72086f9d89f96ad4a0ff18e06ef04
Author: Vincent Siveton <vs...@apache.org>
AuthorDate: Tue May 20 00:26:41 2008 +0000
o readingness pom
o bumped to maven-surefire-plugin:2.4.3
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@658057 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/pom.xml b/pom.xml
index c4f01a4..3c3b296 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,26 +19,29 @@ specific language governing permissions and limitations
under the License.
-->
-<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">
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>11</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
+
<artifactId>maven-ant-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Maven Ant Plugin</name>
<version>2.1-SNAPSHOT</version>
+
<prerequisites>
<maven>2.0.6</maven>
</prerequisites>
+
<issueManagement>
<system>jira</system>
<url>http://jira.codehaus.org/browse/MANT</url>
</issueManagement>
+
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -85,7 +88,18 @@ under the License.
<artifactId>xalan</artifactId>
<version>2.7.0</version>
</dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.0.b2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ <version>1.0-alpha-9</version>
+ </dependency>
+ <!-- test -->
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
@@ -122,18 +136,6 @@ under the License.
<version>3.8.2</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.0.b2</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- <version>1.0-alpha-9</version>
- <scope>compile</scope>
- </dependency>
</dependencies>
<build>
@@ -243,7 +245,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4.3</version>
</plugin>
</plugins>
</build>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 33/48: o Stabilized ITs
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 92154aca1095b44662e016c911b58641ee78634e
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 20:37:28 2008 +0000
o Stabilized ITs
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@640076 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
src/it/ear-it/pom.xml | 4 +--
src/it/encoding-it/goals.txt | 3 +-
src/it/encoding-it/pom.xml | 40 +++++++++++++---------
src/it/file-repo-it/goals.txt | 3 +-
src/it/file-repo-it/pom.xml | 34 +++++++++++-------
src/it/plugin-it/pom.xml | 4 +--
src/it/single-test-it/goals.txt | 3 +-
src/it/single-test-it/pom.xml | 36 +++++++++++--------
src/it/test-custom-selector-it/goals.txt | 3 +-
src/it/test-custom-selector-it/pom.xml | 34 +++++++++++-------
src/it/test-default-selector-it/goals.txt | 3 +-
src/it/test-default-selector-it/pom.xml | 34 +++++++++++-------
src/it/webapp-it/pom.xml | 6 ++--
.../unit/ant-compiler-config-test/pom.xml | 2 +-
src/test/resources/unit/ant-javadoc-test/pom.xml | 2 +-
src/test/resources/unit/ant-test/pom.xml | 2 +-
.../resources/unit/ant-war-config-test/pom.xml | 2 +-
18 files changed, 131 insertions(+), 86 deletions(-)
diff --git a/pom.xml b/pom.xml
index 92e4285..94e8020 100644
--- a/pom.xml
+++ b/pom.xml
@@ -120,7 +120,7 @@ under the License.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/src/it/ear-it/pom.xml b/src/it/ear-it/pom.xml
index 6cd907e..0c075b4 100644
--- a/src/it/ear-it/pom.xml
+++ b/src/it/ear-it/pom.xml
@@ -76,13 +76,13 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ant-plugin</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>@pom.version@</version>
</plugin>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4.2</version>
</plugin>
</plugins>
<pluginManagement>
diff --git a/src/it/encoding-it/goals.txt b/src/it/encoding-it/goals.txt
index 16cd63b..4524f24 100644
--- a/src/it/encoding-it/goals.txt
+++ b/src/it/encoding-it/goals.txt
@@ -1,2 +1,3 @@
+clean
ant:ant
-initialize
+antrun:run
diff --git a/src/it/encoding-it/pom.xml b/src/it/encoding-it/pom.xml
index eae8a56..5ea8cd6 100644
--- a/src/it/encoding-it/pom.xml
+++ b/src/it/encoding-it/pom.xml
@@ -19,24 +19,32 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>build.xml</include>
+ <include>maven-build.*</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
- <executions>
- <execution>
- <phase>initialize</phase>
- <configuration>
- <tasks>
- <!-- delete the properties file to prevent fallback, we want only stuff from the XML file -->
- <delete file="${basedir}/maven-build.properties" />
- <property name="maven.repo.local" location="${settings.localRepository}" />
- <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
+ <configuration>
+ <tasks>
+ <!-- delete the properties file to prevent fallback, we want only stuff from the XML file -->
+ <delete file="${basedir}/maven-build.properties" />
+ <property name="maven.repo.local" location="${settings.localRepository}" />
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
</plugin>
</plugins>
</build>
diff --git a/src/it/file-repo-it/goals.txt b/src/it/file-repo-it/goals.txt
index 16cd63b..4524f24 100644
--- a/src/it/file-repo-it/goals.txt
+++ b/src/it/file-repo-it/goals.txt
@@ -1,2 +1,3 @@
+clean
ant:ant
-initialize
+antrun:run
diff --git a/src/it/file-repo-it/pom.xml b/src/it/file-repo-it/pom.xml
index fe639c9..6e28ef1 100644
--- a/src/it/file-repo-it/pom.xml
+++ b/src/it/file-repo-it/pom.xml
@@ -17,21 +17,29 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>build.xml</include>
+ <include>maven-build.*</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
- <executions>
- <execution>
- <phase>initialize</phase>
- <configuration>
- <tasks>
- <ant dir="${basedir}" antfile="${basedir}/build.xml" target="help" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="help" />
+ </tasks>
+ </configuration>
</plugin>
</plugins>
</build>
diff --git a/src/it/plugin-it/pom.xml b/src/it/plugin-it/pom.xml
index 0e2de7d..ce955d7 100644
--- a/src/it/plugin-it/pom.xml
+++ b/src/it/plugin-it/pom.xml
@@ -98,13 +98,13 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ant-plugin</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>@pom.version@</version>
</plugin>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4.2</version>
</plugin>
</plugins>
</build>
diff --git a/src/it/single-test-it/goals.txt b/src/it/single-test-it/goals.txt
index 16cd63b..4524f24 100644
--- a/src/it/single-test-it/goals.txt
+++ b/src/it/single-test-it/goals.txt
@@ -1,2 +1,3 @@
+clean
ant:ant
-initialize
+antrun:run
diff --git a/src/it/single-test-it/pom.xml b/src/it/single-test-it/pom.xml
index 46eebd0..4cbfb3e 100644
--- a/src/it/single-test-it/pom.xml
+++ b/src/it/single-test-it/pom.xml
@@ -18,22 +18,30 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>build.xml</include>
+ <include>maven-build.*</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
- <executions>
- <execution>
- <phase>initialize</phase>
- <configuration>
- <tasks>
- <property name="test" value="GoodTest" />
- <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
+ <configuration>
+ <tasks>
+ <property name="test" value="GoodTest" />
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
<dependencies>
<dependency>
<groupId>ant</groupId>
diff --git a/src/it/test-custom-selector-it/goals.txt b/src/it/test-custom-selector-it/goals.txt
index 16cd63b..4524f24 100644
--- a/src/it/test-custom-selector-it/goals.txt
+++ b/src/it/test-custom-selector-it/goals.txt
@@ -1,2 +1,3 @@
+clean
ant:ant
-initialize
+antrun:run
diff --git a/src/it/test-custom-selector-it/pom.xml b/src/it/test-custom-selector-it/pom.xml
index 3597c78..deeebc4 100644
--- a/src/it/test-custom-selector-it/pom.xml
+++ b/src/it/test-custom-selector-it/pom.xml
@@ -18,21 +18,29 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>build.xml</include>
+ <include>maven-build.*</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
- <executions>
- <execution>
- <phase>initialize</phase>
- <configuration>
- <tasks>
- <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
<dependencies>
<dependency>
<groupId>ant</groupId>
diff --git a/src/it/test-default-selector-it/goals.txt b/src/it/test-default-selector-it/goals.txt
index 16cd63b..4524f24 100644
--- a/src/it/test-default-selector-it/goals.txt
+++ b/src/it/test-default-selector-it/goals.txt
@@ -1,2 +1,3 @@
+clean
ant:ant
-initialize
+antrun:run
diff --git a/src/it/test-default-selector-it/pom.xml b/src/it/test-default-selector-it/pom.xml
index 30b173c..1d6bd32 100644
--- a/src/it/test-default-selector-it/pom.xml
+++ b/src/it/test-default-selector-it/pom.xml
@@ -18,21 +18,29 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>build.xml</include>
+ <include>maven-build.*</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
- <executions>
- <execution>
- <phase>initialize</phase>
- <configuration>
- <tasks>
- <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
<dependencies>
<dependency>
<groupId>ant</groupId>
diff --git a/src/it/webapp-it/pom.xml b/src/it/webapp-it/pom.xml
index 4905050..96e1f35 100644
--- a/src/it/webapp-it/pom.xml
+++ b/src/it/webapp-it/pom.xml
@@ -33,7 +33,7 @@ under the License.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -80,13 +80,13 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ant-plugin</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>@pom.version@</version>
</plugin>
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.3</version>
+ <version>2.4.2</version>
</plugin>
</plugins>
</build>
diff --git a/src/test/resources/unit/ant-compiler-config-test/pom.xml b/src/test/resources/unit/ant-compiler-config-test/pom.xml
index 1cdc148..3f101af 100644
--- a/src/test/resources/unit/ant-compiler-config-test/pom.xml
+++ b/src/test/resources/unit/ant-compiler-config-test/pom.xml
@@ -34,7 +34,7 @@ under the License.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/src/test/resources/unit/ant-javadoc-test/pom.xml b/src/test/resources/unit/ant-javadoc-test/pom.xml
index ecf70ce..c37f71f 100644
--- a/src/test/resources/unit/ant-javadoc-test/pom.xml
+++ b/src/test/resources/unit/ant-javadoc-test/pom.xml
@@ -34,7 +34,7 @@ under the License.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/src/test/resources/unit/ant-test/pom.xml b/src/test/resources/unit/ant-test/pom.xml
index 3e33c1d..1f9adbe 100644
--- a/src/test/resources/unit/ant-test/pom.xml
+++ b/src/test/resources/unit/ant-test/pom.xml
@@ -34,7 +34,7 @@ under the License.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/src/test/resources/unit/ant-war-config-test/pom.xml b/src/test/resources/unit/ant-war-config-test/pom.xml
index ab2f4ac..e504561 100644
--- a/src/test/resources/unit/ant-war-config-test/pom.xml
+++ b/src/test/resources/unit/ant-war-config-test/pom.xml
@@ -34,7 +34,7 @@ under the License.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <version>3.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 34/48: [MANT-22] Make it possible to run the
package target without tests
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 5ad0930dc5131acfafd05ed6e8ba1c52f5532a6f
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 22:52:46 2008 +0000
[MANT-22] Make it possible to run the package target without tests
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@640113 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/skip-missing-junit-it/custom-build.xml | 13 ++++
src/it/skip-missing-junit-it/goals.txt | 3 +
src/it/skip-missing-junit-it/pom.xml | 70 ++++++++++++++++++++
.../src/test/java/it/SkippedTest.java | 37 +++++++++++
src/it/skip-missing-junit-it/verify.bsh | 14 ++++
src/it/skip-test-compilation-it/goals.txt | 3 +
src/it/skip-test-compilation-it/pom.xml | 74 ++++++++++++++++++++++
.../src/test/java/it/BadTest.java | 31 +++++++++
src/it/skip-test-compilation-it/verify.bsh | 20 ++++++
src/it/skip-test-execution-it/goals.txt | 3 +
src/it/skip-test-execution-it/pom.xml | 74 ++++++++++++++++++++++
.../src/test/java/it/SkippedTest.java | 37 +++++++++++
src/it/skip-test-execution-it/verify.bsh | 14 ++++
.../apache/maven/plugin/ant/AntBuildWriter.java | 43 +++++++++++--
src/site/apt/examples/fail-missing-junit.apt | 8 +--
.../apt/{index.apt => examples/skip-tests.apt} | 36 ++++-------
src/site/apt/index.apt | 2 +
src/site/site.xml | 1 +
18 files changed, 447 insertions(+), 36 deletions(-)
diff --git a/src/it/skip-missing-junit-it/custom-build.xml b/src/it/skip-missing-junit-it/custom-build.xml
new file mode 100644
index 0000000..e36ee1a
--- /dev/null
+++ b/src/it/skip-missing-junit-it/custom-build.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="skip-missing-junit-it" default="package" basedir=".">
+
+ <import file="maven-build.xml"/>
+
+ <target name="junit-missing"
+ depends="test-junit-status"
+ if="junit.missing">
+ <echo level="error">Skipping tests should also work if JUnit is not present at all.</echo>
+ <fail>JUnit not found on class path, cannot run unit tests.</fail>
+ </target>
+
+</project>
diff --git a/src/it/skip-missing-junit-it/goals.txt b/src/it/skip-missing-junit-it/goals.txt
new file mode 100644
index 0000000..4524f24
--- /dev/null
+++ b/src/it/skip-missing-junit-it/goals.txt
@@ -0,0 +1,3 @@
+clean
+ant:ant
+antrun:run
diff --git a/src/it/skip-missing-junit-it/pom.xml b/src/it/skip-missing-junit-it/pom.xml
new file mode 100644
index 0000000..abf54a9
--- /dev/null
+++ b/src/it/skip-missing-junit-it/pom.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.it</groupId>
+ <artifactId>skip-missing-junit-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <version>@pom.version@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>build.xml</include>
+ <include>maven-build.*</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <configuration>
+ <tasks>
+ <property name="maven.test.skip" value="true" />
+ <ant dir="${basedir}" antfile="${basedir}/custom-build.xml" target="test" />
+ </tasks>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- exclude junit -->
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <build.compiler>extJavac</build.compiler>
+ </properties>
+
+</project>
diff --git a/src/it/skip-missing-junit-it/src/test/java/it/SkippedTest.java b/src/it/skip-missing-junit-it/src/test/java/it/SkippedTest.java
new file mode 100644
index 0000000..d386908
--- /dev/null
+++ b/src/it/skip-missing-junit-it/src/test/java/it/SkippedTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class SkippedTest
+ extends TestCase
+{
+
+ public void testFail()
+ throws Exception
+ {
+ fail( "This test should have been skipped." );
+ }
+
+}
diff --git a/src/it/skip-missing-junit-it/verify.bsh b/src/it/skip-missing-junit-it/verify.bsh
new file mode 100644
index 0000000..ecdc765
--- /dev/null
+++ b/src/it/skip-missing-junit-it/verify.bsh
@@ -0,0 +1,14 @@
+import java.io.*;
+import java.util.*;
+
+try
+{
+ // nothing to verify, tests would have failed to build if not skipped
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/src/it/skip-test-compilation-it/goals.txt b/src/it/skip-test-compilation-it/goals.txt
new file mode 100644
index 0000000..4524f24
--- /dev/null
+++ b/src/it/skip-test-compilation-it/goals.txt
@@ -0,0 +1,3 @@
+clean
+ant:ant
+antrun:run
diff --git a/src/it/skip-test-compilation-it/pom.xml b/src/it/skip-test-compilation-it/pom.xml
new file mode 100644
index 0000000..9e433ac
--- /dev/null
+++ b/src/it/skip-test-compilation-it/pom.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.it</groupId>
+ <artifactId>skip-test-compilation-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <version>@pom.version@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>build.xml</include>
+ <include>maven-build.*</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <configuration>
+ <tasks>
+ <property name="maven.test.skip" value="true" />
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="compile-tests" />
+ </tasks>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <build.compiler>extJavac</build.compiler>
+ </properties>
+
+</project>
diff --git a/src/it/skip-test-compilation-it/src/test/java/it/BadTest.java b/src/it/skip-test-compilation-it/src/test/java/it/BadTest.java
new file mode 100644
index 0000000..26622db
--- /dev/null
+++ b/src/it/skip-test-compilation-it/src/test/java/it/BadTest.java
@@ -0,0 +1,31 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class BadTest
+ extends TestCase
+{
+
+// missing closing brace to cause compile error if test not excluded
diff --git a/src/it/skip-test-compilation-it/verify.bsh b/src/it/skip-test-compilation-it/verify.bsh
new file mode 100644
index 0000000..4247f29
--- /dev/null
+++ b/src/it/skip-test-compilation-it/verify.bsh
@@ -0,0 +1,20 @@
+import java.io.*;
+import java.util.*;
+
+try
+{
+ File classesDir = new File( basedir, "target/test-classes" );
+
+ if ( classesDir.exists() )
+ {
+ System.err.println( "Creation of output directory for test classes not skipped: " + classesDir );
+ return false;
+ }
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/src/it/skip-test-execution-it/goals.txt b/src/it/skip-test-execution-it/goals.txt
new file mode 100644
index 0000000..4524f24
--- /dev/null
+++ b/src/it/skip-test-execution-it/goals.txt
@@ -0,0 +1,3 @@
+clean
+ant:ant
+antrun:run
diff --git a/src/it/skip-test-execution-it/pom.xml b/src/it/skip-test-execution-it/pom.xml
new file mode 100644
index 0000000..d230969
--- /dev/null
+++ b/src/it/skip-test-execution-it/pom.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.it</groupId>
+ <artifactId>skip-test-execution-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <version>@pom.version@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>build.xml</include>
+ <include>maven-build.*</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <configuration>
+ <tasks>
+ <property name="maven.test.skip" value="true" />
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="test" />
+ </tasks>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <build.compiler>extJavac</build.compiler>
+ </properties>
+
+</project>
diff --git a/src/it/skip-test-execution-it/src/test/java/it/SkippedTest.java b/src/it/skip-test-execution-it/src/test/java/it/SkippedTest.java
new file mode 100644
index 0000000..d386908
--- /dev/null
+++ b/src/it/skip-test-execution-it/src/test/java/it/SkippedTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class SkippedTest
+ extends TestCase
+{
+
+ public void testFail()
+ throws Exception
+ {
+ fail( "This test should have been skipped." );
+ }
+
+}
diff --git a/src/it/skip-test-execution-it/verify.bsh b/src/it/skip-test-execution-it/verify.bsh
new file mode 100644
index 0000000..ecdc765
--- /dev/null
+++ b/src/it/skip-test-execution-it/verify.bsh
@@ -0,0 +1,14 @@
+import java.io.*;
+import java.util.*;
+
+try
+{
+ // nothing to verify, tests would have failed to build if not skipped
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index 6b54ccf..d7d6636 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -731,9 +731,9 @@ public class AntBuildWriter
{
writer.startElement( "target" );
writer.addAttribute( "name", "compile-tests" );
- AntBuildWriterUtil.addWrapAttribute( writer, "target", "depends", "junit-present, compile", 2 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "target", "depends", "compile", 2 );
AntBuildWriterUtil.addWrapAttribute( writer, "target", "description", "Compile the test code", 2 );
- AntBuildWriterUtil.addWrapAttribute( writer, "target", "if", "junit.present", 2 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "target", "unless", "maven.test.skip", 2 );
writeCompileTasks( writer, project.getBasedir(), "${maven.build.testOutputDir}", testCompileSourceRoots,
project.getBuild().getTestResources(), "${maven.build.outputDir}", true );
@@ -774,15 +774,15 @@ public class AntBuildWriter
{
writer.startElement( "target" );
writer.addAttribute( "name", "test" );
- AntBuildWriterUtil.addWrapAttribute( writer, "target", "depends", "junit-present, compile-tests", 2 );
- AntBuildWriterUtil.addWrapAttribute( writer, "target", "if", "junit.present", 2 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "target", "depends", "compile-tests, junit-missing", 2 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "target", "unless", "junit.skipped", 2 );
AntBuildWriterUtil.addWrapAttribute( writer, "target", "description", "Run the test cases", 2 );
if ( !testCompileSourceRoots.isEmpty() )
{
writer.startElement( "mkdir" );
writer.addAttribute( "dir", "${maven.test.reports}" );
- writer.endElement(); //mkdir
+ writer.endElement(); // mkdir
writer.startElement( "junit" );
writer.addAttribute( "printSummary", "yes" );
@@ -857,9 +857,38 @@ public class AntBuildWriter
AntBuildWriterUtil.writeLineBreak( writer, 2, 1 );
writer.startElement( "target" );
- writer.addAttribute( "name", "junit-present" );
+ writer.addAttribute( "name", "test-junit-status" );
AntBuildWriterUtil.addWrapAttribute( writer, "target", "depends", "test-junit-present", 2 );
- AntBuildWriterUtil.addWrapAttribute( writer, "target", "unless", "junit.present", 2 );
+ writer.startElement( "condition" );
+ writer.addAttribute( "property", "junit.missing" );
+ writer.startElement( "and" );
+ writer.startElement( "isfalse" );
+ writer.addAttribute( "value", "${junit.present}" );
+ writer.endElement(); // isfalse
+ writer.startElement( "isfalse" );
+ writer.addAttribute( "value", "${maven.test.skip}" );
+ writer.endElement(); // isfalse
+ writer.endElement(); // and
+ writer.endElement(); // condition
+ writer.startElement( "condition" );
+ writer.addAttribute( "property", "junit.skipped" );
+ writer.startElement( "or" );
+ writer.startElement( "isfalse" );
+ writer.addAttribute( "value", "${junit.present}" );
+ writer.endElement(); // isfalse
+ writer.startElement( "istrue" );
+ writer.addAttribute( "value", "${maven.test.skip}" );
+ writer.endElement(); // istrue
+ writer.endElement(); // or
+ writer.endElement(); // condition
+ writer.endElement(); // target
+
+ AntBuildWriterUtil.writeLineBreak( writer, 2, 1 );
+
+ writer.startElement( "target" );
+ writer.addAttribute( "name", "junit-missing" );
+ AntBuildWriterUtil.addWrapAttribute( writer, "target", "depends", "test-junit-status", 2 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "target", "if", "junit.missing", 2 );
writer.startElement( "echo" );
writer.writeText( StringUtils.repeat( "=", 35 ) + " WARNING " + StringUtils.repeat( "=", 35 ) );
diff --git a/src/site/apt/examples/fail-missing-junit.apt b/src/site/apt/examples/fail-missing-junit.apt
index 7db0299..0521f50 100644
--- a/src/site/apt/examples/fail-missing-junit.apt
+++ b/src/site/apt/examples/fail-missing-junit.apt
@@ -45,10 +45,10 @@ Failing the Build if JUnit is Missing
<!-- Unit testing, overridden to fail upon missing JUnit -->
<!-- ====================================================================== -->
- <target name="junit-present"
- depends="test-junit-present"
- unless="junit.present">
- <property name="ant.libdir" location="${ant.home}/lib" />
+ <target name="junit-missing"
+ depends="test-junit-status"
+ if="junit.missing">
+ <property name="ant.libdir" location="${ant.home}/lib"/>
<echo level="error">==================================== ERROR ====================================</echo>
<echo level="error"> JUnit is not present in your $ANT_HOME/lib directory, aborting build. </echo>
<echo level="error"> Please copy "junit.jar" to "${ant.libdir}". </echo>
diff --git a/src/site/apt/index.apt b/src/site/apt/examples/skip-tests.apt
similarity index 50%
copy from src/site/apt/index.apt
copy to src/site/apt/examples/skip-tests.apt
index 2d39c20..1824f79 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/examples/skip-tests.apt
@@ -1,9 +1,9 @@
------
- Introduction
+ Skipping Unit Tests
------
- Vincent Siveton
+ Benjamin Bentmann
------
- September 2006
+ March 2008
------
~~ Copyright 2006 The Apache Software Foundation.
@@ -24,28 +24,14 @@
~~ http://maven.apache.org/guides/mini/guide-apt-format.html
-Maven 2 Ant Plugin
+Skipping Unit Tests
- The Ant Plugin generates build files for {{{http://ant.apache.org/}Ant}} 1.6.2 or above from the POM.
+ Although not recommended as a general practice, you sometimes may want to skip the unit tests when packaging the
+ artifact. Starting with Ant Plugin 2.1, the generated Ant build files allow this via the system property
+ <<<maven.test.skip>>>:
-* Goals Overview
++-----+
+ant package -Dmaven.test.skip=true
++-----+
- The Ant Plugin has two goals:
-
- * {{{ant-mojo.html}ant:ant}} Generate Ant build files.
-
- * {{{clean-mojo.html}ant:clean}} Clean all Ant build files.
-
-* Usage
-
- Instructions on how to use the Ant Plugin can be found on the {{{usage.html}usage page}}.
-
-* Examples
-
- The following examples show how to use the Ant Plugin in more advanced usecases:
-
- * {{{examples/customize.html}Customizing Generated Ant Build Files}}
-
- * {{{examples/run-single-test.html}Running Individual Unit Tests}}
-
- * {{{examples/fail-missing-junit.html}Failing the Build if JUnit is Missing}}
+ The above command will both skip the compilation of the unit tests and their execution.
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
index 2d39c20..e093219 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/index.apt
@@ -49,3 +49,5 @@ Maven 2 Ant Plugin
* {{{examples/run-single-test.html}Running Individual Unit Tests}}
* {{{examples/fail-missing-junit.html}Failing the Build if JUnit is Missing}}
+
+ * {{{examples/skip-tests.html}Skipping Unit Tests}}
diff --git a/src/site/site.xml b/src/site/site.xml
index 0b1cf9d..10b1e56 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -35,6 +35,7 @@ under the License.
<item name="Customizing Ant Build Files" href="/examples/customize.html"/>
<item name="Running Individual Unit Tests" href="/examples/run-single-test.html"/>
<item name="Failing if JUnit is Missing" href="/examples/fail-missing-junit.html"/>
+ <item name="Skipping Unit Tests" href="/examples/skip-tests.html"/>
</menu>
</body>
</project>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 32/48: o Added some line breaks to the build
scripts
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit f556e04c4792d4c8524f47091be10d20bef6b274
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 18:29:26 2008 +0000
o Added some line breaks to the build scripts
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@640041 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index c3618d9..6b54ccf 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -313,8 +313,12 @@ public class AntBuildWriter
// ----------------------------------------------------------------------
writeGetDepsTarget( writer );
+ AntBuildWriterUtil.writeLineBreak( writer );
+
writer.endElement(); // project
+ AntBuildWriterUtil.writeLineBreak( writer );
+
IOUtil.close( w );
}
@@ -378,10 +382,12 @@ public class AntBuildWriter
writer.endElement(); // target
- AntBuildWriterUtil.writeLineBreak( writer );
+ AntBuildWriterUtil.writeLineBreak( writer, 2 );
writer.endElement(); // project
+ AntBuildWriterUtil.writeLineBreak( writer );
+
IOUtil.close( w );
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 13/48: [MANT-34] The generated maven-build.xml
and maven-build.properties contains absolute path to local repository
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 207d70f8b07adf3b1f48ce4396e8cf14d858c5b3
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sun Jan 6 17:21:24 2008 +0000
[MANT-34] The generated maven-build.xml and maven-build.properties contains absolute path to local repository
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@609349 13f79535-47bb-0310-9956-ffa450edef68
---
.../apache/maven/plugin/ant/AntBuildWriter.java | 24 ++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index 300e9e2..8d80613 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -204,7 +204,7 @@ public class AntBuildWriter
addProperty( properties, "maven.settings.offline", String.valueOf( settings.isOffline() ) );
addProperty( properties, "maven.settings.interactiveMode", String.valueOf( settings.isInteractiveMode() ) );
- addProperty( properties, "maven.repo.local", localRepository.getAbsolutePath() );
+ addProperty( properties, "maven.repo.local", getLocalRepositoryPath() );
// ----------------------------------------------------------------------
// Project properties
@@ -500,7 +500,7 @@ public class AntBuildWriter
writer.startElement( "property" );
writer.addAttribute( "name", "maven.repo.local" );
- writer.addAttribute( "value", localRepository.getAbsolutePath() );
+ writer.addAttribute( "value", getLocalRepositoryPath() );
writer.endElement(); // property
writer.startElement( "property" );
@@ -517,6 +517,26 @@ public class AntBuildWriter
}
/**
+ * Check if the local repository is in the default location:
+ * <code>${user.home}/.m2/repository</code>. If that is the case then return
+ * the path with the system property "user.home" in it. If not then just
+ * return the absolute path to the local repository.
+ */
+ private String getLocalRepositoryPath() {
+ String userHome = System.getProperty( "user.home" );
+ String defaultPath = ( userHome + "/.m2/repository" ).replace( '\\', '/' );
+ String actualPath = localRepository.getAbsolutePath().replace( '\\', '/' );
+ if( actualPath.equals( defaultPath ) )
+ {
+ return "${user.home}/.m2/repository";
+ }
+ else
+ {
+ return localRepository.getAbsolutePath();
+ }
+ }
+
+ /**
* Write path definition in the writer only for a non-POM project.
*
* @param writer
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 23/48: [MANT-32] java.lang.ClassCastException
when packaging jeuclid-3.0.1
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 969914360b4d5fef9dfb936930d3f1f0b3378a16
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 21:28:30 2008 +0000
[MANT-32] java.lang.ClassCastException when packaging jeuclid-3.0.1
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639856 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/plugin/ant/AntBuildWriterUtil.java | 49 +++++++++++++++++++---
.../maven/plugin/ant/AntBuildWriterUtilTest.java | 18 ++++++++
.../unit/ant-compiler-config-test/pom.xml | 3 ++
3 files changed, 64 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
index a214eb8..df4b066 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
@@ -1257,16 +1257,53 @@ public class AntBuildWriterUtil
String lastNodeName = null;
for ( int i = 0; i < childs.getLength(); i++ )
{
- if ( childs.item( i ).getNodeType() == Node.ELEMENT_NODE )
+ Node child = childs.item( i );
+ if ( child.getNodeType() == Node.ELEMENT_NODE )
{
- if ( i != 0 )
- {
- isList = isList || ( childs.item( i ).getNodeName().equals( lastNodeName ) );
- }
- lastNodeName = childs.item( i ).getNodeName();
+ isList = isList || ( child.getNodeName().equals( lastNodeName ) );
+ lastNodeName = child.getNodeName();
}
}
+ if ( StringUtils.isNotEmpty( lastNodeName ) )
+ {
+ isList = isList || lastNodeName.equals( getSingularForm( node.getNodeName() ) );
+ }
return isList;
}
+
+ /**
+ * Gets the singular form of the specified (English) plural form. For example:
+ *
+ * <pre>
+ * properties -> property
+ * branches -> branch
+ * reports -> report
+ * </pre>
+ *
+ * @param pluralForm The plural form for which to derive the singular form, may be <code>null</code>.
+ * @return The corresponding singular form or an empty string if the input string was not recognized as a plural
+ * form.
+ */
+ static String getSingularForm( String pluralForm )
+ {
+ String singularForm = "";
+ if ( StringUtils.isNotEmpty( pluralForm ) )
+ {
+ if ( pluralForm.endsWith( "ies" ) )
+ {
+ singularForm = pluralForm.substring( 0, pluralForm.length() - 3 ) + 'y';
+ }
+ else if ( pluralForm.endsWith( "ches" ) )
+ {
+ singularForm = pluralForm.substring( 0, pluralForm.length() - 2 );
+ }
+ else if ( pluralForm.endsWith( "s" ) && pluralForm.length() > 1 )
+ {
+ singularForm = pluralForm.substring( 0, pluralForm.length() - 1 );
+ }
+ }
+ return singularForm;
+ }
+
}
diff --git a/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java b/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java
index 3bcc628..8f5663f 100644
--- a/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java
+++ b/src/test/java/org/apache/maven/plugin/ant/AntBuildWriterUtilTest.java
@@ -105,6 +105,8 @@ public class AntBuildWriterUtilTest
assertNotNull( AntBuildWriterUtil.getMavenCompilerPluginOptions( project, "includes", null ) );
assertEquals( AntBuildWriterUtil.getMavenCompilerPluginOptions( project, "includes", null ).length, 2 );
+ assertNotNull( AntBuildWriterUtil.getMavenCompilerPluginOptions( project, "excludes", null ) );
+ assertEquals( AntBuildWriterUtil.getMavenCompilerPluginOptions( project, "excludes", null ).length, 1 );
maven.stop();
}
@@ -164,4 +166,20 @@ public class AntBuildWriterUtilTest
maven.stop();
}
+
+ /**
+ * Test method for {@link AntBuildWriterUtil#getSingularForm(String)}.
+ *
+ * @throws Exception
+ */
+ public static void testGetSingularForm()
+ throws Exception
+ {
+ assertEquals( "property", AntBuildWriterUtil.getSingularForm( "properties" ) );
+ assertEquals( "branch", AntBuildWriterUtil.getSingularForm( "branches" ) );
+ assertEquals( "report", AntBuildWriterUtil.getSingularForm( "reports" ) );
+ assertEquals( "", AntBuildWriterUtil.getSingularForm( "singular" ) );
+ assertEquals( "", AntBuildWriterUtil.getSingularForm( null ) );
+ }
+
}
diff --git a/src/test/resources/unit/ant-compiler-config-test/pom.xml b/src/test/resources/unit/ant-compiler-config-test/pom.xml
index d9a4a99..1cdc148 100644
--- a/src/test/resources/unit/ant-compiler-config-test/pom.xml
+++ b/src/test/resources/unit/ant-compiler-config-test/pom.xml
@@ -45,6 +45,9 @@ under the License.
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<debug>true</debug>
+ <excludes>
+ <exclude>**/reversemapping/Main.java</exclude>
+ </excludes>
<includes>
<include>**/*.java</include>
<include>**/*.jad</include>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 37/48: encoding-it should not fail if platform
encoding does not support tested characters
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 31cbe99277fe8e04bcdcb9a9c7e97d151b7329ab
Author: Herve Boutemy <hb...@apache.org>
AuthorDate: Thu Apr 3 21:55:21 2008 +0000
encoding-it should not fail if platform encoding does not support tested characters
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@644526 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/encoding-it/verify.bsh | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/it/encoding-it/verify.bsh b/src/it/encoding-it/verify.bsh
index d4f9d86..a12e1f0 100644
--- a/src/it/encoding-it/verify.bsh
+++ b/src/it/encoding-it/verify.bsh
@@ -13,7 +13,19 @@ try
if ( file.getName().indexOf( '?' ) >= 0 )
{
System.err.println( "JAR file name contains corrupted characters: " + file );
- return false;
+ System.err.println( "Platform encoding: " + System.getProperty( "file.encoding" ) );
+ String expected = "\u00E4\u00F6\u00FC\u00DF";
+ System.err.println( "expected string with this platform encoding:" + expected );
+ String result = new String( expected.getBytes() );
+ if ( expected.equals( result ) )
+ {
+ System.err.println( "Platform encoding supports these characters, filename should not be corrupted." );
+ return false;
+ }
+ else
+ {
+ System.err.println( "WARN: Platform encoding does not support these characters: filename is corrupted, but cannot determine if it's plugins' fault or not." );
+ }
}
return true;
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 48/48: [maven-release-plugin] copy for tag
maven-ant-plugin-2.1
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit b54a97401cb01c6135c74ae30b435f76bf64146a
Author: Vincent Siveton <vs...@apache.org>
AuthorDate: Tue May 20 02:02:22 2008 +0000
[maven-release-plugin] copy for tag maven-ant-plugin-2.1
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.1@658086 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 18 +++++++++++------
src/site/apt/examples/customize.apt | 25 +++++++++++++-----------
src/site/apt/examples/fail-missing-junit.apt | 29 +++++++++++++++-------------
src/site/apt/examples/skip-tests.apt | 25 +++++++++++++-----------
src/site/apt/index.apt | 25 +++++++++++++-----------
src/site/apt/usage.apt | 26 +++++++++++++------------
src/site/fml/faq.fml | 29 +++++++++++++++-------------
7 files changed, 100 insertions(+), 77 deletions(-)
diff --git a/pom.xml b/pom.xml
index 3c3b296..fa832ad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@ under the License.
<artifactId>maven-ant-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Maven Ant Plugin</name>
- <version>2.1-SNAPSHOT</version>
+ <version>2.1</version>
<prerequisites>
<maven>2.0.6</maven>
@@ -42,26 +42,32 @@ under the License.
<url>http://jira.codehaus.org/browse/MANT</url>
</issueManagement>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.1</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.1</developerConnection>
+ <url>http://svn.apache.org/viewvc/maven/plugins/tags/maven-ant-plugin-2.1</url>
+ </scm>
+
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
- <version>2.0.4</version>
+ <version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
- <version>2.0.4</version>
+ <version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
- <version>2.0.4</version>
+ <version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
- <version>2.0.4</version>
+ <version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
@@ -115,7 +121,7 @@ under the License.
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
- <version>2.0.4</version>
+ <version>2.0.6</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/src/site/apt/examples/customize.apt b/src/site/apt/examples/customize.apt
index d0a9347..0e6847a 100644
--- a/src/site/apt/examples/customize.apt
+++ b/src/site/apt/examples/customize.apt
@@ -6,19 +6,22 @@
September 2006
------
- ~~ Copyright 2006 The Apache Software Foundation.
+ ~~ 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
~~
- ~~ Licensed 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
~~
- ~~ 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.
+ ~~ 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
diff --git a/src/site/apt/examples/fail-missing-junit.apt b/src/site/apt/examples/fail-missing-junit.apt
index 079d86f..da02028 100644
--- a/src/site/apt/examples/fail-missing-junit.apt
+++ b/src/site/apt/examples/fail-missing-junit.apt
@@ -6,19 +6,22 @@
March 2008
------
- ~~ Copyright 2006 The Apache Software Foundation.
+ ~~ 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
~~
- ~~ Licensed 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
~~
- ~~ 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.
+ ~~ 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
@@ -45,8 +48,8 @@ Failing the Build if JUnit is Missing
<!-- Unit testing, overridden to fail upon missing JUnit -->
<!-- ====================================================================== -->
- <target name="junit-missing"
- depends="test-junit-status"
+ <target name="junit-missing"
+ depends="test-junit-status"
if="junit.missing">
<property name="ant.libdir" location="${ant.home}/lib"/>
<echo level="error">==================================== ERROR ====================================</echo>
diff --git a/src/site/apt/examples/skip-tests.apt b/src/site/apt/examples/skip-tests.apt
index 7af0975..e866759 100644
--- a/src/site/apt/examples/skip-tests.apt
+++ b/src/site/apt/examples/skip-tests.apt
@@ -6,19 +6,22 @@
March 2008
------
- ~~ Copyright 2006 The Apache Software Foundation.
+ ~~ 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
~~
- ~~ Licensed 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
~~
- ~~ 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.
+ ~~ 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
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
index 683fe7a..858974a 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/index.apt
@@ -6,19 +6,22 @@
September 2006
------
- ~~ Copyright 2006 The Apache Software Foundation.
+ ~~ 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
~~
- ~~ Licensed 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
~~
- ~~ 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.
+ ~~ 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
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index 7197ff3..294411c 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -6,24 +6,26 @@
September 2006
------
- ~~ Copyright 2006 The Apache Software Foundation.
+ ~~ 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
~~
- ~~ Licensed 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
~~
- ~~ 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.
+ ~~ 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
The Ant Plugin generates Ant build files from POMs. The following example describe the basic
diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml
index de6d2e0..ac3b3cc 100644
--- a/src/site/fml/faq.fml
+++ b/src/site/fml/faq.fml
@@ -1,19 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- ~ Copyright 2006 The Apache Software Foundation.
- ~
- ~ Licensed 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.
+ 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.
-->
<faqs id="FAQ" title="Frequently Asked Questions">
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 12/48: [MANT-35] The generated maven-build.xml
has paths that contain \ characters on Windows
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 8884f29711deffcef526da631c2c58f16efb746d
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sun Jan 6 17:18:55 2008 +0000
[MANT-35] The generated maven-build.xml has paths that contain \ characters on Windows
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@609348 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index f501ca4..300e9e2 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -1130,7 +1130,8 @@ public class AntBuildWriter
if ( parentDirs != null )
{
writer.startElement( "mkdir" );
- writer.addAttribute( "dir", "${maven.repo.local}/" + parentDirs.getPath() );
+ // Replace \ with / in the parent dir path
+ writer.addAttribute( "dir", "${maven.repo.local}/" + parentDirs.getPath().replace( '\\', '/' ) );
writer.endElement(); // mkdir
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 45/48: o lock down plugins for it
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit b6ed9e02ea763482ccc32bf9711fed88238400fe
Author: Vincent Siveton <vs...@apache.org>
AuthorDate: Tue May 20 00:21:00 2008 +0000
o lock down plugins for it
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@658056 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/ear-it/ear/pom.xml | 1 +
src/it/ear-it/ejbs/pom.xml | 1 +
src/it/ear-it/pom.xml | 1 +
src/it/ear-it/primary-source/pom.xml | 2 ++
4 files changed, 5 insertions(+)
diff --git a/src/it/ear-it/ear/pom.xml b/src/it/ear-it/ear/pom.xml
index 70d1adb..3e19642 100644
--- a/src/it/ear-it/ear/pom.xml
+++ b/src/it/ear-it/ear/pom.xml
@@ -61,6 +61,7 @@ under the License.
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
+ <version>2.3.1</version>
<configuration>
<archive>
<manifest>
diff --git a/src/it/ear-it/ejbs/pom.xml b/src/it/ear-it/ejbs/pom.xml
index b64a994..6aad7a0 100644
--- a/src/it/ear-it/ejbs/pom.xml
+++ b/src/it/ear-it/ejbs/pom.xml
@@ -49,6 +49,7 @@ under the License.
<plugins>
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
+ <version>2.1</version>
<configuration>
<archive>
<manifest>
diff --git a/src/it/ear-it/pom.xml b/src/it/ear-it/pom.xml
index 711668a..929cc0d 100644
--- a/src/it/ear-it/pom.xml
+++ b/src/it/ear-it/pom.xml
@@ -101,6 +101,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-6</version>
<configuration>
<unzipCommand>/usr/bin/unzip -o > err.txt</unzipCommand>
</configuration>
diff --git a/src/it/ear-it/primary-source/pom.xml b/src/it/ear-it/primary-source/pom.xml
index 611b411..f0ba636 100644
--- a/src/it/ear-it/primary-source/pom.xml
+++ b/src/it/ear-it/primary-source/pom.xml
@@ -44,6 +44,7 @@ under the License.
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
<configuration>
<encoding>iso-8859-1</encoding>
</configuration>
@@ -51,6 +52,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
<configuration>
<minmemory>128m</minmemory>
<maxmemory>512m</maxmemory>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 42/48: o Avoided usage of
StringInputStream/StringOutputStream with regard to PLXUTILS-70
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 6e580946491eaec47d8866a52a5e07f09bbdecf4
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Apr 19 11:49:07 2008 +0000
o Avoided usage of StringInputStream/StringOutputStream with regard to PLXUTILS-70
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@649799 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java | 4 ++--
src/test/java/org/apache/maven/plugin/ant/AntWrapper.java | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
index bb5a2b0..8e25c4b 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
@@ -19,6 +19,7 @@ package org.apache.maven.plugin.ant;
* under the License.
*/
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
@@ -39,7 +40,6 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.wagon.PathUtils;
import org.apache.xpath.XPathAPI;
import org.apache.xpath.objects.XObject;
-import org.codehaus.plexus.util.StringInputStream;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.XMLWriter;
import org.codehaus.plexus.util.xml.Xpp3Dom;
@@ -1129,7 +1129,7 @@ public class AntBuildWriterUtil
try
{
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder()
- .parse( new StringInputStream( pluginConf.toString() ) );
+ .parse( new ByteArrayInputStream( pluginConf.toString().getBytes( "UTF-8" ) ) );
XObject obj = XPathAPI.eval( doc, "//configuration/" + optionName );
diff --git a/src/test/java/org/apache/maven/plugin/ant/AntWrapper.java b/src/test/java/org/apache/maven/plugin/ant/AntWrapper.java
index 6e2b4ee..cd24122 100644
--- a/src/test/java/org/apache/maven/plugin/ant/AntWrapper.java
+++ b/src/test/java/org/apache/maven/plugin/ant/AntWrapper.java
@@ -19,6 +19,7 @@ package org.apache.maven.plugin.ant;
* under the License.
*/
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.OutputStream;
import java.io.PrintStream;
@@ -28,7 +29,6 @@ import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.ExitException;
import org.apache.tools.ant.Main;
import org.apache.tools.ant.util.optional.NoExitSecurityManager;
-import org.codehaus.plexus.util.StringOutputStream;
import org.codehaus.plexus.util.StringUtils;
/**
@@ -73,12 +73,12 @@ public class AntWrapper
System.setSecurityManager( new NoExitSecurityManager() );
PrintStream oldErr = System.err;
- OutputStream errOS = new StringOutputStream();
+ OutputStream errOS = new ByteArrayOutputStream();
PrintStream err = new PrintStream( errOS );
System.setErr( err );
PrintStream oldOut = System.out;
- OutputStream outOS = new StringOutputStream();
+ OutputStream outOS = new ByteArrayOutputStream();
PrintStream out = new PrintStream( outOS );
System.setOut( out );
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 17/48: o Fixed svn:keywords
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit df06a095e0b55f7357c94a52298d2612ee2b0e64
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 13:58:11 2008 +0000
o Fixed svn:keywords
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639646 13f79535-47bb-0310-9956-ffa450edef68
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 06/48: o set surefire version to try to avoid CI
build failures
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 8cdef31d6c25c8b4b217924c7911829c571847f0
Author: Vincent Siveton <vs...@apache.org>
AuthorDate: Thu Aug 30 10:13:00 2007 +0000
o set surefire version to try to avoid CI build failures
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@571100 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 15 +++++++++++++++
src/it/ear-it/pom.xml | 6 ++++++
src/it/plugin-it/pom.xml | 6 ++++++
src/it/webapp-it/pom.xml | 6 ++++++
4 files changed, 33 insertions(+)
diff --git a/pom.xml b/pom.xml
index 332635a..0e8a758 100644
--- a/pom.xml
+++ b/pom.xml
@@ -137,6 +137,16 @@ under the License.
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ </plugin>
+ </plugins>
+ </build>
+
<profiles>
<profile>
<id>integration-tests</id>
@@ -245,6 +255,11 @@ under the License.
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ </plugin>
</plugins>
</build>
</profile>
diff --git a/src/it/ear-it/pom.xml b/src/it/ear-it/pom.xml
index a7c99b8..6cd907e 100644
--- a/src/it/ear-it/pom.xml
+++ b/src/it/ear-it/pom.xml
@@ -78,6 +78,12 @@ under the License.
<artifactId>maven-ant-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
</plugin>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
diff --git a/src/it/plugin-it/pom.xml b/src/it/plugin-it/pom.xml
index 232e13d..0e2de7d 100644
--- a/src/it/plugin-it/pom.xml
+++ b/src/it/plugin-it/pom.xml
@@ -100,6 +100,12 @@ under the License.
<artifactId>maven-ant-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
</plugin>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ </plugin>
</plugins>
</build>
diff --git a/src/it/webapp-it/pom.xml b/src/it/webapp-it/pom.xml
index 5b3558b..4905050 100644
--- a/src/it/webapp-it/pom.xml
+++ b/src/it/webapp-it/pom.xml
@@ -82,6 +82,12 @@ under the License.
<artifactId>maven-ant-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
</plugin>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ </plugin>
</plugins>
</build>
</project>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 02/48: [maven-release-plugin] prepare for next
development iteration
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 916183cf0f7d46d0b28f72df1456b95b3dede13a
Author: Carlos Sanchez Gonzalez <ca...@apache.org>
AuthorDate: Fri May 18 17:11:37 2007 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@539524 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/pom.xml b/pom.xml
index f9c1697..dd9e758 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
<artifactId>maven-ant-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Maven Ant Plugin</name>
- <version>2.0</version>
+ <version>2.1-SNAPSHOT</version>
<prerequisites>
<maven>2.0.4</maven>
</prerequisites>
@@ -226,10 +226,4 @@
</build>
</profile>
</profiles>
-
- <scm>
- <connection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.0</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.0</developerConnection>
- <url>https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.0</url>
- </scm>
</project>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 40/48: o Moved the IT verification into the
invoker controlled builds for better failure analysis
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit a5dedc8429f32785a42dcf4159dd7b411915e80e
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Apr 5 19:25:41 2008 +0000
o Moved the IT verification into the invoker controlled builds for better failure analysis
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@645163 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 34 +++++++++++-----------------------
src/it/ear-it/goals-2.txt | 1 +
src/it/ear-it/goals.txt | 3 +++
src/it/ear-it/pom.xml | 11 +++++++++++
src/it/plugin-it/goals.txt | 3 +++
src/it/plugin-it/pom.xml | 11 +++++++++++
src/it/webapp-it/goals.txt | 3 +++
src/it/webapp-it/pom.xml | 12 +++++++++++-
8 files changed, 54 insertions(+), 24 deletions(-)
diff --git a/pom.xml b/pom.xml
index 913707c..581b7dd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -212,8 +212,9 @@ under the License.
</pomIncludes>
<postBuildHookScript>verify.bsh</postBuildHookScript>
<goals>
- <!-- Install to the target local-repo -->
- <goal>install ant:ant</goal>
+ <goal>clean</goal>
+ <goal>ant:ant</goal>
+ <goal>antrun:run</goal>
</goals>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
</configuration>
@@ -225,31 +226,18 @@ under the License.
<goal>run</goal>
</goals>
</execution>
- </executions>
- </plugin>
- <!-- Verify the results by calling Ant -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <executions>
<execution>
- <phase>post-integration-test</phase>
- <configuration>
- <tasks>
- <ant dir="${basedir}/src/it/ear-it" antfile="${basedir}/src/it/ear-it/build.xml" target="clean" />
- <ant dir="${basedir}/src/it/ear-it" antfile="${basedir}/src/it/ear-it/build.xml" target="package" />
-
- <ant dir="${basedir}/src/it/webapp-it" antfile="${basedir}/src/it/webapp-it/build.xml" target="clean" />
- <ant dir="${basedir}/src/it/webapp-it" antfile="${basedir}/src/it/webapp-it/build.xml" target="package" />
-
- <ant dir="${basedir}/src/it/plugin-it" antfile="${basedir}/src/it/plugin-it/build.xml" target="clean" />
- <ant dir="${basedir}/src/it/plugin-it" antfile="${basedir}/src/it/plugin-it/build.xml" target="package" />
- </tasks>
- </configuration>
+ <id>integration-test-phase-2</id>
+ <phase>integration-test</phase>
<goals>
<goal>run</goal>
</goals>
+ <configuration>
+ <pomIncludes>
+ <pomInclude>ear-it/pom.xml</pomInclude>
+ </pomIncludes>
+ <goalsFile>goals-2.txt</goalsFile>
+ </configuration>
</execution>
</executions>
</plugin>
diff --git a/src/it/ear-it/goals-2.txt b/src/it/ear-it/goals-2.txt
new file mode 100644
index 0000000..7179f2c
--- /dev/null
+++ b/src/it/ear-it/goals-2.txt
@@ -0,0 +1 @@
+antrun:run
diff --git a/src/it/ear-it/goals.txt b/src/it/ear-it/goals.txt
new file mode 100644
index 0000000..96f7752
--- /dev/null
+++ b/src/it/ear-it/goals.txt
@@ -0,0 +1,3 @@
+clean
+install
+ant:ant
diff --git a/src/it/ear-it/pom.xml b/src/it/ear-it/pom.xml
index 0c075b4..711668a 100644
--- a/src/it/ear-it/pom.xml
+++ b/src/it/ear-it/pom.xml
@@ -84,6 +84,17 @@ under the License.
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="clean" />
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
diff --git a/src/it/plugin-it/goals.txt b/src/it/plugin-it/goals.txt
new file mode 100644
index 0000000..4524f24
--- /dev/null
+++ b/src/it/plugin-it/goals.txt
@@ -0,0 +1,3 @@
+clean
+ant:ant
+antrun:run
diff --git a/src/it/plugin-it/pom.xml b/src/it/plugin-it/pom.xml
index ce955d7..f492f3c 100644
--- a/src/it/plugin-it/pom.xml
+++ b/src/it/plugin-it/pom.xml
@@ -106,6 +106,17 @@ under the License.
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="clean" />
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
+ </plugin>
</plugins>
</build>
diff --git a/src/it/webapp-it/goals.txt b/src/it/webapp-it/goals.txt
new file mode 100644
index 0000000..4524f24
--- /dev/null
+++ b/src/it/webapp-it/goals.txt
@@ -0,0 +1,3 @@
+clean
+ant:ant
+antrun:run
diff --git a/src/it/webapp-it/pom.xml b/src/it/webapp-it/pom.xml
index 96e1f35..72f8589 100644
--- a/src/it/webapp-it/pom.xml
+++ b/src/it/webapp-it/pom.xml
@@ -75,7 +75,6 @@ under the License.
<build>
<finalName>ant-webapp-test</finalName>
-
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -88,6 +87,17 @@ under the License.
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="clean" />
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 24/48: [MANT-34] The generated maven-build.xml
and maven-build.properties contains absolute path to local repository
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit d1d0ed46b86d3454ea668ef0d129d7cb86f001a5
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 22:12:27 2008 +0000
[MANT-34] The generated maven-build.xml and maven-build.properties contains absolute path to local repository
o Altered original fix to never use absolute repo path in the maven-build.xml but always have the generic default value there
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639886 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index 1011dc8..a81e456 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -508,7 +508,7 @@ public class AntBuildWriter
writer.startElement( "property" );
writer.addAttribute( "name", "maven.repo.local" );
- writer.addAttribute( "value", getLocalRepositoryPath() );
+ writer.addAttribute( "value", "${user.home}/.m2/repository" );
writer.endElement(); // property
writer.startElement( "property" );
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 21/48: o Decoupled unit tests from default
encoding of executing JVM for build reproducibility
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit e6419cd2b189ef22a139893ee1cec63225c4fe32
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 17:01:37 2008 +0000
o Decoupled unit tests from default encoding of executing JVM for build reproducibility
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639714 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java
index d761b50..c1f05e3 100644
--- a/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java
@@ -20,7 +20,8 @@ package org.apache.maven.plugin.ant.stubs;
*/
import java.io.File;
-import java.io.FileReader;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
import java.util.Collections;
import java.util.List;
import java.util.Properties;
@@ -59,7 +60,9 @@ public abstract class AbstractAntTestMavenProjectStub
try
{
- model = pomReader.read( new FileReader( new File( antTestDir, "pom.xml" ) ) );
+ File pomFile = new File( antTestDir, "pom.xml" );
+ // TODO: Once plexus-utils has been bumped to 1.4.4, use ReaderFactory.newXmlReader()
+ model = pomReader.read( new InputStreamReader( new FileInputStream( pomFile ), "UTF-8" ) );
setModel( model );
}
catch ( Exception e )
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 08/48: add more info to find out why it is
failing on Solaris
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 486e215dd545c0d6ab92d6106d7b87c677743af1
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Mon Oct 29 06:34:58 2007 +0000
add more info to find out why it is failing on Solaris
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@589516 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
index 4cfb083..83083ff 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
@@ -1182,7 +1182,7 @@ public class AntBuildWriterUtil
}
catch ( Exception e )
{
- throw new IOException( "Exception occured: " + e.getMessage() );
+ throw new IOException( "Exception occured: " + e.getMessage(), e );
}
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 07/48: o forced download to try to avoid CI
build failures
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 6f5c36d050effce7075f61e0c8170f3ef59225b2
Author: Vincent Siveton <vs...@apache.org>
AuthorDate: Tue Sep 4 22:47:19 2007 +0000
o forced download to try to avoid CI build failures
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@572829 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index b30fd33..f501ca4 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -1141,7 +1141,7 @@ public class AntBuildWriter
writer.startElement( "get" );
writer.addAttribute( "src", repository.getUrl() + "/" + path );
AntBuildWriterUtil.addWrapAttribute( writer, "get", "dest", "${maven.repo.local}/" + path, 3 );
- AntBuildWriterUtil.addWrapAttribute( writer, "get", "usetimestamp", "true", 3 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "get", "usetimestamp", "false", 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "get", "ignoreerrors", "true", 3 );
writer.endElement(); // get
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 09/48: forgot IOException doesn't take this arg
even in JDK 1.4+. Going with a temporary solution.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 16d35b3b5380b6f255447f7a4efa9034b2981da7
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Mon Oct 29 06:43:54 2007 +0000
forgot IOException doesn't take this arg even in JDK 1.4+. Going with a temporary solution.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@589522 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
index 83083ff..241655e 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
@@ -1182,7 +1182,8 @@ public class AntBuildWriterUtil
}
catch ( Exception e )
{
- throw new IOException( "Exception occured: " + e.getMessage(), e );
+ e.printStackTrace();
+ throw new IOException( "Exception occured: " + e.getMessage() );
}
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 36/48: o Bumped to latest parent
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 44e3e064b09831824e0fa6951dc91dca8beedeb6
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 28 00:48:07 2008 +0000
o Bumped to latest parent
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@642051 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 94e8020..37f78c5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
- <version>8</version>
+ <version>10</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-ant-plugin</artifactId>
@@ -262,4 +262,4 @@ under the License.
</build>
</profile>
</profiles>
-</project>
\ No newline at end of file
+</project>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 15/48: o Ignore IDEA files.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit c74a8efa16c4a46199ed5f1b286fc03de0117a83
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sun Jan 6 18:31:50 2008 +0000
o Ignore IDEA files.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@609368 13f79535-47bb-0310-9956-ffa450edef68
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 35/48: o Fixed docs
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 6e85328fad8c13f63a09e54594682a4dec876633
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 23:00:47 2008 +0000
o Fixed docs
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@640116 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/apt/examples/fail-missing-junit.apt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/site/apt/examples/fail-missing-junit.apt b/src/site/apt/examples/fail-missing-junit.apt
index 0521f50..f09460c 100644
--- a/src/site/apt/examples/fail-missing-junit.apt
+++ b/src/site/apt/examples/fail-missing-junit.apt
@@ -29,7 +29,7 @@ Failing the Build if JUnit is Missing
The build scripts generated by the Ant Plugin require JUnit to run the unit tests. By default, the <<<build.xml>>> will
only output a warning if JUnit was not found on the class path, i.e. the build simply continues without running the
unit tests. If you rather want the build to fail in this case, you can easily customize the <<<build.xml>>> by
- overriding the target <<<junit-present>>>:
+ overriding the target <<<junit-missing>>>:
+-----+
<?xml version="1.0" encoding="UTF-8"?>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 01/48: [maven-release-plugin] prepare release
maven-ant-plugin-2.0
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit f63e26074693ab4003b44a98d2c3f43cf8393195
Author: Carlos Sanchez Gonzalez <ca...@apache.org>
AuthorDate: Fri May 18 17:11:25 2007 +0000
[maven-release-plugin] prepare release maven-ant-plugin-2.0
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@539522 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 43 +++++++++++++++----------------------------
1 file changed, 15 insertions(+), 28 deletions(-)
diff --git a/pom.xml b/pom.xml
index 72f73b7..f9c1697 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,23 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
-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.
--->
-<project 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' xmlns='http://maven.apache.org/POM/4.0.0'>
+<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">
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
@@ -27,7 +8,7 @@ under the License.
<artifactId>maven-ant-plugin</artifactId>
<packaging>maven-plugin</packaging>
<name>Maven Ant Plugin</name>
- <version>2.0-SNAPSHOT</version>
+ <version>2.0</version>
<prerequisites>
<maven>2.0.4</maven>
</prerequisites>
@@ -225,14 +206,14 @@ under the License.
<phase>post-integration-test</phase>
<configuration>
<tasks>
- <ant dir='${basedir}/src/it/ear-it' antfile='${basedir}/src/it/ear-it/build.xml' target='clean'/>
- <ant dir='${basedir}/src/it/ear-it' antfile='${basedir}/src/it/ear-it/build.xml' target='package'/>
+ <ant dir="${basedir}/src/it/ear-it" antfile="${basedir}/src/it/ear-it/build.xml" target="clean" />
+ <ant dir="${basedir}/src/it/ear-it" antfile="${basedir}/src/it/ear-it/build.xml" target="package" />
- <ant dir='${basedir}/src/it/webapp-it' antfile='${basedir}/src/it/webapp-it/build.xml' target='clean'/>
- <ant dir='${basedir}/src/it/webapp-it' antfile='${basedir}/src/it/webapp-it/build.xml' target='package'/>
+ <ant dir="${basedir}/src/it/webapp-it" antfile="${basedir}/src/it/webapp-it/build.xml" target="clean" />
+ <ant dir="${basedir}/src/it/webapp-it" antfile="${basedir}/src/it/webapp-it/build.xml" target="package" />
- <ant dir='${basedir}/src/it/plugin-it' antfile='${basedir}/src/it/plugin-it/build.xml' target='clean'/>
- <ant dir='${basedir}/src/it/plugin-it' antfile='${basedir}/src/it/plugin-it/build.xml' target='package'/>
+ <ant dir="${basedir}/src/it/plugin-it" antfile="${basedir}/src/it/plugin-it/build.xml" target="clean" />
+ <ant dir="${basedir}/src/it/plugin-it" antfile="${basedir}/src/it/plugin-it/build.xml" target="package" />
</tasks>
</configuration>
<goals>
@@ -245,4 +226,10 @@ under the License.
</build>
</profile>
</profiles>
-</project>
+
+ <scm>
+ <connection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.0</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.0</developerConnection>
+ <url>https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ant-plugin-2.0</url>
+ </scm>
+</project>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 30/48: [MANT-7] "test" target should support
running a single test - just like mvn test does
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 732a9f938fa24e90bde7ccd57011c97cf7f857ef
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 14:47:51 2008 +0000
[MANT-7] "test" target should support running a single test - just like mvn test does
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@640004 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/single-test-it/goals.txt | 2 +
src/it/single-test-it/pom.xml | 66 ++++++++++++++++
.../single-test-it/src/test/java/it/BadTest.java | 37 +++++++++
.../single-test-it/src/test/java/it/GoodTest.java | 37 +++++++++
src/it/single-test-it/verify.bsh | 23 ++++++
.../apache/maven/plugin/ant/AntBuildWriter.java | 89 +++++++++++++++++-----
src/site/apt/examples/{using.apt => customize.apt} | 6 +-
.../{index.apt => examples/run-single-test.apt} | 36 ++++-----
src/site/apt/index.apt | 8 +-
src/site/apt/usage.apt | 6 +-
src/site/fml/faq.fml | 4 +-
src/site/site.xml | 3 +-
12 files changed, 264 insertions(+), 53 deletions(-)
diff --git a/src/it/single-test-it/goals.txt b/src/it/single-test-it/goals.txt
new file mode 100644
index 0000000..16cd63b
--- /dev/null
+++ b/src/it/single-test-it/goals.txt
@@ -0,0 +1,2 @@
+ant:ant
+initialize
diff --git a/src/it/single-test-it/pom.xml b/src/it/single-test-it/pom.xml
new file mode 100644
index 0000000..46eebd0
--- /dev/null
+++ b/src/it/single-test-it/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.it</groupId>
+ <artifactId>single-test-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <version>@pom.version@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <configuration>
+ <tasks>
+ <property name="test" value="GoodTest" />
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <build.compiler>extJavac</build.compiler>
+ </properties>
+
+</project>
diff --git a/src/it/single-test-it/src/test/java/it/BadTest.java b/src/it/single-test-it/src/test/java/it/BadTest.java
new file mode 100644
index 0000000..447024f
--- /dev/null
+++ b/src/it/single-test-it/src/test/java/it/BadTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class BadTest
+ extends TestCase
+{
+
+ public void testFail()
+ throws Exception
+ {
+ fail( "This test should have been excluded." );
+ }
+
+}
diff --git a/src/it/single-test-it/src/test/java/it/GoodTest.java b/src/it/single-test-it/src/test/java/it/GoodTest.java
new file mode 100644
index 0000000..c6f6032
--- /dev/null
+++ b/src/it/single-test-it/src/test/java/it/GoodTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class GoodTest
+ extends TestCase
+{
+
+ public void testPass()
+ throws Exception
+ {
+ assertTrue( true );
+ }
+
+}
diff --git a/src/it/single-test-it/verify.bsh b/src/it/single-test-it/verify.bsh
new file mode 100644
index 0000000..c993878
--- /dev/null
+++ b/src/it/single-test-it/verify.bsh
@@ -0,0 +1,23 @@
+import java.io.*;
+import java.util.*;
+
+try
+{
+ File reportDir = new File( basedir, "target/test-reports" );
+
+ {
+ File file = new File( reportDir, "TEST-it.GoodTest.xml" );
+ if ( !file.isFile() )
+ {
+ System.err.println( "Report file does not exist: " + file );
+ return false;
+ }
+ }
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index ac9cab6..17bba3b 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -43,6 +43,8 @@ import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
import org.codehaus.plexus.util.xml.XMLWriter;
+import sun.security.action.GetIntegerAction;
+
/**
* Write Ant build files from <code>Maven Project</code> for <a href="http://ant.apache.org">Ant</a> 1.6.2 or above:
* <ul>
@@ -814,30 +816,23 @@ public class AntBuildWriter
writer.startElement( "batchtest" );
writer.addAttribute( "todir", "${maven.test.reports}" );
+ writer.addAttribute( "unless", "test" );
- List includes =
- getSelectorList( AntBuildWriterUtil.getMavenSurefirePluginOptions( project, "includes", null ) );
- if ( includes == null || includes.isEmpty() )
- {
- includes = Arrays.asList( new String[] { "**/Test*.java", "**/*Test.java", "**/*TestCase.java" } );
- }
+ List includes = getTestIncludes();
+ List excludes = getTestExcludes();
- List excludes =
- getSelectorList( AntBuildWriterUtil.getMavenSurefirePluginOptions( project, "excludes", null ) );
- if ( excludes == null || excludes.isEmpty() )
- {
- excludes = Arrays.asList( new String[] { "**/*Abstract*Test.java" } );
- }
+ writeTestFilesets( writer, testCompileSourceRoots, includes, excludes );
+
+ writer.endElement(); // batchtest
+
+ writer.startElement( "batchtest" );
+ writer.addAttribute( "todir", "${maven.test.reports}" );
+ writer.addAttribute( "if", "test" );
+
+ includes = Arrays.asList( new String[] { "**/${test}.java" } );
+
+ writeTestFilesets( writer, testCompileSourceRoots, includes, excludes );
- String[] compileSourceRoots = (String[]) testCompileSourceRoots.toArray( new String[0] );
- for ( int i = 0; i < compileSourceRoots.length; i++ )
- {
- writer.startElement( "fileset" );
- writer.addAttribute( "dir", "${maven.build.testDir." + i + "}" );
- // TODO: m1 allows additional test exclusions via maven.ant.excludeTests
- AntBuildWriterUtil.writeIncludesExcludes( writer, includes, excludes );
- writer.endElement(); // fileset
- }
writer.endElement(); // batchtest
writer.endElement(); // junit
@@ -882,6 +877,58 @@ public class AntBuildWriter
}
/**
+ * Gets the include patterns for the unit tests.
+ *
+ * @return A list of strings with include patterns, might be empty but never <code>null</code>.
+ */
+ private List getTestIncludes()
+ throws IOException
+ {
+ List includes = getSelectorList( AntBuildWriterUtil.getMavenSurefirePluginOptions( project, "includes", null ) );
+ if ( includes == null || includes.isEmpty() )
+ {
+ includes = Arrays.asList( new String[] { "**/Test*.java", "**/*Test.java", "**/*TestCase.java" } );
+ }
+ return includes;
+ }
+
+ /**
+ * Gets the exclude patterns for the unit tests.
+ *
+ * @return A list of strings with exclude patterns, might be empty but never <code>null</code>.
+ */
+ private List getTestExcludes()
+ throws IOException
+ {
+ List excludes = getSelectorList( AntBuildWriterUtil.getMavenSurefirePluginOptions( project, "excludes", null ) );
+ if ( excludes == null || excludes.isEmpty() )
+ {
+ excludes = Arrays.asList( new String[] { "**/*Abstract*Test.java" } );
+ }
+ return excludes;
+ }
+
+ /**
+ * Write the <code><fileset></code> elements for the test compile source roots.
+ *
+ * @param writer
+ * @param testCompileSourceRoots
+ * @param includes
+ * @param excludes
+ */
+ private void writeTestFilesets( XMLWriter writer, List testCompileSourceRoots, List includes, List excludes )
+ {
+ for ( int i = 0; i < testCompileSourceRoots.size(); i++ )
+ {
+ writer.startElement( "fileset" );
+ writer.addAttribute( "dir", "${maven.build.testDir." + i + "}" );
+ // TODO: m1 allows additional test exclusions via maven.ant.excludeTests
+ AntBuildWriterUtil.writeIncludesExcludes( writer, includes, excludes );
+ writer.endElement(); // fileset
+ }
+ }
+
+ /**
* Write javadoc target in the writer depending the packaging of the project.
*
* @param writer
diff --git a/src/site/apt/examples/using.apt b/src/site/apt/examples/customize.apt
similarity index 91%
rename from src/site/apt/examples/using.apt
rename to src/site/apt/examples/customize.apt
index d2af823..0c72265 100644
--- a/src/site/apt/examples/using.apt
+++ b/src/site/apt/examples/customize.apt
@@ -1,5 +1,5 @@
------
- Grammar Inheritance
+ Customizing Generated Ant Build Files
------
Vincent Siveton
------
@@ -24,9 +24,9 @@
~~ http://maven.apache.org/guides/mini/guide-apt-format.html
-Using generated Ant build files
+Customizing Generated Ant Build Files
- <<Note>>: If you want to add your own Ant targets, you should add them to <<<build.xml>>> and <<NOT>> <<<maven-build.xml>>>.
+ <<Warning>>: If you want to add your own Ant targets, you should add them to <<<build.xml>>> and <not> to <<<maven-build.xml>>>.
The <<<build.xml>>> file uses the {{{http://ant.apache.org/manual/CoreTasks/import.html}import task}} of Ant.
So, you can override the generated targets in the <<<build.xml>>> file. For instance:
diff --git a/src/site/apt/index.apt b/src/site/apt/examples/run-single-test.apt
similarity index 53%
copy from src/site/apt/index.apt
copy to src/site/apt/examples/run-single-test.apt
index 865bb77..d55da8c 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/examples/run-single-test.apt
@@ -1,9 +1,9 @@
------
- Introduction
+ Running Individual Unit Tests
------
- Vincent Siveton
+ Benjamin Bentmann
------
- September 2006
+ March 2008
------
~~ Copyright 2006 The Apache Software Foundation.
@@ -24,24 +24,20 @@
~~ http://maven.apache.org/guides/mini/guide-apt-format.html
-Maven 2 Ant Plugin
+Running Individual Unit Tests
- The Ant Plugin generates {{{http://ant.apache.org/}Ant}} build files for Ant 1.6.2 or above.
+ Since version 2.1 of the Ant Plugin, the generated Ant build files allow to run individual unit tests. You merely need
+ to specify the simple name of the desired test class via the system property <<<test>>> as illustrated below:
-* Goals Overview
++-----+
+ant test -Dtest=MyFavoriteTest
++-----+
- The Ant Plugin has two goals:
+ This will run a test matching the pattern <<<**/MyFavoriteTest.java>>>. You can also employ a simple pattern to select
+ multiple tests:
+
++-----+
+ant test -Dtest=*FavoriteTest
++-----+
- * {{{ant-mojo.html}ant:ant}} Generate Ant build files.
-
- * {{{clean-mojo.html}ant:clean}} Clean all Ant build files.
-
-* Usage
-
- Instructions on how to use the Ant Plugin can be found {{{usage.html}here}}.
-
-* Examples
-
- The following examples show how to use the Ant Plugin in more advanced usecases:
-
- * {{{examples/using.html}Using generated Ant build files}}
+ <<Note>>: Unlike the Surefire Plugin, the Ant scripts do not support a comma-separated value for the <<<test>>> property.
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
index 865bb77..014bd2d 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/index.apt
@@ -26,7 +26,7 @@
Maven 2 Ant Plugin
- The Ant Plugin generates {{{http://ant.apache.org/}Ant}} build files for Ant 1.6.2 or above.
+ The Ant Plugin generates build files for {{{http://ant.apache.org/}Ant}} 1.6.2 or above from the POM.
* Goals Overview
@@ -38,10 +38,12 @@ Maven 2 Ant Plugin
* Usage
- Instructions on how to use the Ant Plugin can be found {{{usage.html}here}}.
+ Instructions on how to use the Ant Plugin can be found on the {{{usage.html}usage page}}.
* Examples
The following examples show how to use the Ant Plugin in more advanced usecases:
- * {{{examples/using.html}Using generated Ant build files}}
+ * {{{examples/customize.html}Customizing Generated Ant Build Files}}
+
+ * {{{examples/run-single-test.html}Running Individual Unit Tests}}
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index 6459292..af8ac75 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -26,7 +26,7 @@
Usage
- The Ant Plugin generates Ant build files. The following example describe the basic
+ The Ant Plugin generates Ant build files from POMs. The following example describe the basic
usage of the Plugin.
* Generate Ant build files
@@ -93,10 +93,10 @@ mvn ant:ant -Doverwrite=true
ant -projecthelp
+-----+
- <<Note>>: <<DO NOT EDIT maven-build.xml!>> It will be overwritten when calling <<<mvn ant:ant>>>.
+ <<Warning>>: Do not edit <<<maven-build.xml>>>! It will be overwritten when calling <<<mvn ant:ant>>>.
** maven-build.properties
The <<<maven-build.properties>>> file contains several properties used by the <<<maven-build.xml>>> build file.
- <<Note>>: <<DO NOT EDIT maven-build.properties!>> It will be overwritten when calling <<<mvn ant:ant>>>.
+ <<Warning>>: Do not edit <<<maven-build.properties>>>! It will be overwritten when calling <<<mvn ant:ant>>>.
diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml
index a46b9de..de6d2e0 100644
--- a/src/site/fml/faq.fml
+++ b/src/site/fml/faq.fml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2006 The Apache Software Foundation.
@@ -35,4 +35,4 @@
</answer>
</faq>
</part>
-</faqs>
\ No newline at end of file
+</faqs>
diff --git a/src/site/site.xml b/src/site/site.xml
index dd3d94c..a5cd266 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -32,7 +32,8 @@ under the License.
<item name="FAQ" href="faq.html"/>
</menu>
<menu name="Examples">
- <item name="Using Ant build files" href="/examples/using.html"/>
+ <item name="Customizing Ant Build Files" href="/examples/customize.html"/>
+ <item name="Running Individual Unit Tests" href="/examples/run-single-test.html"/>
</menu>
</body>
</project>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 11/48: o Improve documentation.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 7898ccb23aeafa5c778acaff23efa422ba3bf76d
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sun Jan 6 15:33:08 2008 +0000
o Improve documentation.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@609329 13f79535-47bb-0310-9956-ffa450edef68
---
.../java/org/apache/maven/plugin/ant/AntMojo.java | 10 ++++----
src/site/apt/examples/using.apt | 8 +++---
src/site/apt/usage.apt | 30 +++++++++++++---------
3 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntMojo.java b/src/main/java/org/apache/maven/plugin/ant/AntMojo.java
index 6407fba..a93386b 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntMojo.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntMojo.java
@@ -51,21 +51,21 @@ public class AntMojo
private MavenProject project;
/**
- * Used for resolving artifacts
+ * Used for resolving artifacts.
*
* @component
*/
private ArtifactResolver resolver;
/**
- * Factory for creating artifact objects
+ * Factory for creating artifact objects.
*
* @component
*/
private ArtifactFactory factory;
/**
- * The local repository where the artifacts are located
+ * The local repository where the artifacts are located.
*
* @parameter expression="${localRepository}"
* @required
@@ -73,7 +73,7 @@ public class AntMojo
private ArtifactRepository localRepository;
/**
- * The remote repositories where artifacts are located
+ * The remote repositories where artifacts are located.
*
* @parameter expression="${project.remoteArtifactRepositories}"
*/
@@ -89,7 +89,7 @@ public class AntMojo
private Settings settings;
/**
- * Overwrite or not the <code>build.xml</code>
+ * Whether or not to overwrite the <code>build.xml</code> file.
*
* @parameter expression="${overwrite}" default-value="false"
*/
diff --git a/src/site/apt/examples/using.apt b/src/site/apt/examples/using.apt
index 430d356..d2af823 100644
--- a/src/site/apt/examples/using.apt
+++ b/src/site/apt/examples/using.apt
@@ -26,10 +26,10 @@
Using generated Ant build files
- <<Note>>: You should update the <<<build.xml>>> and <<NOT>> the <<<maven-build.xml>>>.
+ <<Note>>: If you want to add your own Ant targets, you should add them to <<<build.xml>>> and <<NOT>> <<<maven-build.xml>>>.
- The <<<build.xml>>> uses the {{{http://ant.apache.org/manual/CoreTasks/import.html}import task}} of Ant.
- So, you could overwrite generated targets in the <<<build.xml>>>. For instance:
+ The <<<build.xml>>> file uses the {{{http://ant.apache.org/manual/CoreTasks/import.html}import task}} of Ant.
+ So, you can override the generated targets in the <<<build.xml>>> file. For instance:
+-----+
<?xml version="1.0" encoding="UTF-8"?>
@@ -55,7 +55,7 @@ Using generated Ant build files
</target>
<!-- ====================================================================== -->
- <!-- Overwrite the jar target from maven-build.xml -->
+ <!-- Override the jar target from maven-build.xml -->
<!-- ====================================================================== -->
<target name="jar">
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index 07c8388..6459292 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -31,7 +31,7 @@ Usage
* Generate Ant build files
- To generate files, you should execute the ant goal of the Ant Plugin, i.e.:
+ To generate files, you execute the <<<ant>>> goal of the Ant Plugin, i.e.:
+-----+
mvn ant:ant
@@ -41,14 +41,15 @@ mvn ant:ant
+-----+
yourProjectBaseDir
- |-- build.xml
- `-- maven-build.xml
- `-- maven-build.properties
+|-- build.xml
+|-- maven-build.xml
+`-- maven-build.properties
+-----+
** build.xml
- The <<<build.xml>>> is a generic Ant build file. It could be updated by the user. Here is the out-of-box <<<build.xml>>>:
+ The <<<build.xml>>> file is a generic Ant build file. It can be updated by the user.
+ Here is the out-of-box <<<build.xml>>>:
+-----+
<?xml version="1.0" encoding="UTF-8"?>
@@ -75,8 +76,9 @@ yourProjectBaseDir
</project>
+-----+
- <<Note>>: By default, the <<<build.xml>>> is not overwrited when calling <<<mvn ant:ant>>>. If you want to overwrite it,
- you should execute the ant goal with the <<<overwrite>>> parameter, i.e.:
+ <<Note>>: By default, the <<<build.xml>>> file is not overwritten when calling <<<mvn ant:ant>>>.
+ If you want to overwrite it,
+ you should execute the <<<ant>>> goal with the <<<overwrite>>> parameter, i.e.:
+-----+
mvn ant:ant -Doverwrite=true
@@ -84,13 +86,17 @@ mvn ant:ant -Doverwrite=true
** maven-build.xml
- The <<<maven-build.xml>>> is an Ant build file for the Maven project. It contains several targets to clean, compile,
- test, packaging the Ant project and the associated javadoc.
+ The <<<maven-build.xml>>> file is an Ant build file for your project. It contains several targets to clean, compile,
+ test and package your project and also to create javadoc. To see which Ant targets are available execute this command:
- <<Note>>: <<DO NOT EDIT maven-build.xml!>> It could be overwrite when calling <<<mvn ant:ant>>>.
++-----+
+ant -projecthelp
++-----+
+
+ <<Note>>: <<DO NOT EDIT maven-build.xml!>> It will be overwritten when calling <<<mvn ant:ant>>>.
** maven-build.properties
- The <<<maven-build.properties>>> contains several properties used by the <<<maven-build.xml>>> build file.
+ The <<<maven-build.properties>>> file contains several properties used by the <<<maven-build.xml>>> build file.
- <<Note>>: <<DO NOT EDIT maven-build.properties!>> It could be overwrite when calling <<<mvn ant:ant>>>.
+ <<Note>>: <<DO NOT EDIT maven-build.properties!>> It will be overwritten when calling <<<mvn ant:ant>>>.
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 27/48: [MANT-38] Use reporting output directory
configured in POM
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit e2c01919945ac8742abc33c919eccbb670cb435d
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 10:10:41 2008 +0000
[MANT-38] Use reporting output directory configured in POM
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639969 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java | 9 ++++++++-
.../maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java | 6 +++++-
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 29f505c..92e4285 100644
--- a/pom.xml
+++ b/pom.xml
@@ -90,7 +90,7 @@ under the License.
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.0-beta-1</version>
+ <version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index 6d1164b..8f9a3d2 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -495,9 +495,16 @@ public class AntBuildWriter
writer.addAttribute( "value", "${maven.build.dir}/test-reports" );
writer.endElement(); // property
+ String reportingOutputDir = project.getReporting().getOutputDirectory();
+ // workaround for MNG-3475
+ if ( !new File( reportingOutputDir ).isAbsolute() )
+ {
+ reportingOutputDir = new File( project.getBasedir(), reportingOutputDir ).getAbsolutePath();
+ }
writer.startElement( "property" );
writer.addAttribute( "name", "maven.reporting.outputDirectory" );
- writer.addAttribute( "value", "${maven.build.dir}/site" );
+ writer.addAttribute( "value", "${maven.build.dir}/"
+ + PathUtils.toRelative( new File( project.getBuild().getDirectory() ), reportingOutputDir ) );
writer.endElement(); // property
// ----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java
index c1f05e3..dd25542 100644
--- a/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugin/ant/stubs/AbstractAntTestMavenProjectStub.java
@@ -96,7 +96,11 @@ public abstract class AbstractAntTestMavenProjectStub
setBuild( build );
- getModel().setReporting( new Reporting() );
+ Reporting reporting = new Reporting();
+
+ reporting.setOutputDirectory( getBasedir().getAbsolutePath() + "/target/site" );
+
+ getModel().setReporting( reporting );
}
/**
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 22/48: o Added bin to svn:ignore
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 455efd955142313eafe0e93ce1d038fdf35d67c2
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 21:18:06 2008 +0000
o Added bin to svn:ignore
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639848 13f79535-47bb-0310-9956-ffa450edef68
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 28/48: [MANT-39] Always specify source/target
options for javac
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit dd2696058e847bcadcaee3916b03668135427fe7
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 12:44:08 2008 +0000
[MANT-39] Always specify source/target options for javac
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639986 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index 8f9a3d2..561f7a0 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -1010,7 +1010,7 @@ public class AntBuildWriter
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "deprecation", AntBuildWriterUtil
.getMavenCompilerPluginBasicOption( project, "showDeprecation", "true" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "target", AntBuildWriterUtil
- .getMavenCompilerPluginBasicOption( project, "target", null ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "target", "1.1" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "verbose", AntBuildWriterUtil
.getMavenCompilerPluginBasicOption( project, "verbose", "false" ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "fork", AntBuildWriterUtil
@@ -1020,7 +1020,7 @@ public class AntBuildWriter
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "memoryInitialSize", AntBuildWriterUtil
.getMavenCompilerPluginBasicOption( project, "maxmem", null ), 3 );
AntBuildWriterUtil.addWrapAttribute( writer, "javac", "source", AntBuildWriterUtil
- .getMavenCompilerPluginBasicOption( project, "source", null ), 3 );
+ .getMavenCompilerPluginBasicOption( project, "source", "1.3" ), 3 );
String[] compileSourceRootsArray = (String[]) compileSourceRoots.toArray( new String[0] );
for ( int i = 0; i < compileSourceRootsArray.length; i++ )
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 31/48: [MANT-6] "test" targets should fail if
junit.jar not present
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 3d291cde3729698edcc7862b9d132154e80abc8f
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 17:22:21 2008 +0000
[MANT-6] "test" targets should fail if junit.jar not present
o Added example to show how to realize this by target overriding
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@640016 13f79535-47bb-0310-9956-ffa450edef68
---
.../apache/maven/plugin/ant/AntBuildWriter.java | 5 +-
src/site/apt/examples/customize.apt | 2 +-
src/site/apt/examples/fail-missing-junit.apt | 61 ++++++++++++++++++++++
src/site/apt/index.apt | 2 +
src/site/site.xml | 1 +
5 files changed, 66 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index 17bba3b..c3618d9 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -25,7 +25,6 @@ import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -43,8 +42,6 @@ import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
import org.codehaus.plexus.util.xml.XMLWriter;
-import sun.security.action.GetIntegerAction;
-
/**
* Write Ant build files from <code>Maven Project</code> for <a href="http://ant.apache.org">Ant</a> 1.6.2 or above:
* <ul>
@@ -863,7 +860,7 @@ public class AntBuildWriter
writer.endElement(); // echo
writer.startElement( "echo" );
- writer.writeText( " Junit isn't present in your $ANT_HOME/lib directory. Tests not executed. " );
+ writer.writeText( " JUnit is not present in your $ANT_HOME/lib directory. Tests not executed." );
writer.endElement(); // echo
writer.startElement( "echo" );
diff --git a/src/site/apt/examples/customize.apt b/src/site/apt/examples/customize.apt
index 0c72265..c1ddca3 100644
--- a/src/site/apt/examples/customize.apt
+++ b/src/site/apt/examples/customize.apt
@@ -38,7 +38,7 @@ Customizing Generated Ant Build Files
<!-- Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above. -->
<!-- ====================================================================== -->
-<project name="%PROJECT_ARTIFACTID%" default="jar" basedir=".">
+<project name="%PROJECT_ARTIFACT_ID%" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Import maven-build.xml into the current project -->
diff --git a/src/site/apt/examples/fail-missing-junit.apt b/src/site/apt/examples/fail-missing-junit.apt
new file mode 100644
index 0000000..7db0299
--- /dev/null
+++ b/src/site/apt/examples/fail-missing-junit.apt
@@ -0,0 +1,61 @@
+ ------
+ Failing the Build if JUnit is Missing
+ ------
+ Benjamin Bentmann
+ ------
+ March 2008
+ ------
+
+ ~~ Copyright 2006 The Apache Software Foundation.
+ ~~
+ ~~ Licensed 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/guides/mini/guide-apt-format.html
+
+
+Failing the Build if JUnit is Missing
+
+ The build scripts generated by the Ant Plugin require JUnit to run the unit tests. By default, the <<<build.xml>>> will
+ only output a warning if JUnit was not found on the class path, i.e. the build simply continues without running the
+ unit tests. If you rather want the build to fail in this case, you can easily customize the <<<build.xml>>> by
+ overriding the target <<<junit-present>>>:
+
++-----+
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above. -->
+<!-- ====================================================================== -->
+
+<project name="%PROJECT_ARTIFACT_ID%" default="package" basedir=".">
+ ...
+
+ <!-- ====================================================================== -->
+ <!-- Unit testing, overridden to fail upon missing JUnit -->
+ <!-- ====================================================================== -->
+
+ <target name="junit-present"
+ depends="test-junit-present"
+ unless="junit.present">
+ <property name="ant.libdir" location="${ant.home}/lib" />
+ <echo level="error">==================================== ERROR ====================================</echo>
+ <echo level="error"> JUnit is not present in your $ANT_HOME/lib directory, aborting build. </echo>
+ <echo level="error"> Please copy "junit.jar" to "${ant.libdir}". </echo>
+ <echo level="error">===============================================================================</echo>
+ <fail>JUnit not found on class path, cannot run unit tests.</fail>
+ </target>
+
+ ...
+</project>
++-----+
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
index 014bd2d..2d39c20 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/index.apt
@@ -47,3 +47,5 @@ Maven 2 Ant Plugin
* {{{examples/customize.html}Customizing Generated Ant Build Files}}
* {{{examples/run-single-test.html}Running Individual Unit Tests}}
+
+ * {{{examples/fail-missing-junit.html}Failing the Build if JUnit is Missing}}
diff --git a/src/site/site.xml b/src/site/site.xml
index a5cd266..0b1cf9d 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -34,6 +34,7 @@ under the License.
<menu name="Examples">
<item name="Customizing Ant Build Files" href="/examples/customize.html"/>
<item name="Running Individual Unit Tests" href="/examples/run-single-test.html"/>
+ <item name="Failing if JUnit is Missing" href="/examples/fail-missing-junit.html"/>
</menu>
</body>
</project>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 19/48: [MANT-36] Use correct file encoding when
writing build files
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 43be7874f1db76b2379115639377f0efeb2e08e1
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 16:18:35 2008 +0000
[MANT-36] Use correct file encoding when writing build files
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639695 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 6 +--
src/it/encoding-it/goals.txt | 2 +
src/it/encoding-it/pom.xml | 43 ++++++++++++++++++++++
src/it/encoding-it/verify.bsh | 30 +++++++++++++++
.../apache/maven/plugin/ant/AntBuildWriter.java | 20 +++++++---
5 files changed, 91 insertions(+), 10 deletions(-)
diff --git a/pom.xml b/pom.xml
index 0e8a758..29f505c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -203,14 +203,12 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
- <version>1.0</version>
+ <version>1.1</version>
<configuration>
<debug>true</debug>
<projectsDirectory>src/it</projectsDirectory>
<pomIncludes>
- <pomInclude>ear-it/pom.xml</pomInclude>
- <pomInclude>webapp-it/pom.xml</pomInclude>
- <pomInclude>plugin-it/pom.xml</pomInclude>
+ <pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
<postBuildHookScript>verify.bsh</postBuildHookScript>
<goals>
diff --git a/src/it/encoding-it/goals.txt b/src/it/encoding-it/goals.txt
new file mode 100644
index 0000000..16cd63b
--- /dev/null
+++ b/src/it/encoding-it/goals.txt
@@ -0,0 +1,2 @@
+ant:ant
+initialize
diff --git a/src/it/encoding-it/pom.xml b/src/it/encoding-it/pom.xml
new file mode 100644
index 0000000..5a1afc4
--- /dev/null
+++ b/src/it/encoding-it/pom.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.it</groupId>
+ <artifactId>encoding-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <!-- some non-ascii characters here -->
+ <finalName>encoding-it-äöüß</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <configuration>
+ <tasks>
+ <!-- delete the properties file to prevent fallback, we want only stuff from the XML file -->
+ <delete file="${basedir}/maven-build.properties"/>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/src/it/encoding-it/verify.bsh b/src/it/encoding-it/verify.bsh
new file mode 100644
index 0000000..d4f9d86
--- /dev/null
+++ b/src/it/encoding-it/verify.bsh
@@ -0,0 +1,30 @@
+import java.io.*;
+import java.util.*;
+
+try
+{
+ File targetDir = new File( basedir, "target" );
+ File[] files = targetDir.listFiles();
+ for ( int i = 0; i < files.length; i++ )
+ {
+ File file = files[i];
+ if ( file.getName().toLowerCase( Locale.ENGLISH ).endsWith( ".jar" ) )
+ {
+ if ( file.getName().indexOf( '?' ) >= 0 )
+ {
+ System.err.println( "JAR file name contains corrupted characters: " + file );
+ return false;
+ }
+ return true;
+ }
+ }
+ System.err.println( "Could not find generated JAR file" );
+ return false;
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index c111fcb..1011dc8 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -21,8 +21,8 @@ package org.apache.maven.plugin.ant;
import java.io.File;
import java.io.FileOutputStream;
-import java.io.FileWriter;
import java.io.IOException;
+import java.io.OutputStreamWriter;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -232,9 +232,13 @@ public class AntBuildWriter
throws IOException
{
// TODO: parameter
- FileWriter w = new FileWriter( new File( project.getBasedir(), DEFAULT_MAVEN_BUILD_FILENAME ) );
+ File outputFile = new File( project.getBasedir(), DEFAULT_MAVEN_BUILD_FILENAME );
- XMLWriter writer = new PrettyPrintXMLWriter( w, StringUtils.repeat( " ", DEFAULT_INDENTATION_SIZE ), "UTF-8",
+ String encoding = "UTF-8";
+
+ OutputStreamWriter w = new OutputStreamWriter( new FileOutputStream( outputFile ), encoding );
+
+ XMLWriter writer = new PrettyPrintXMLWriter( w, StringUtils.repeat( " ", DEFAULT_INDENTATION_SIZE ), encoding,
null );
// ----------------------------------------------------------------------
@@ -322,14 +326,18 @@ public class AntBuildWriter
private void writeBuildXml()
throws IOException
{
- if ( new File( project.getBasedir(), DEFAULT_BUILD_FILENAME ).exists() && !overwrite )
+ File outputFile = new File( project.getBasedir(), DEFAULT_BUILD_FILENAME );
+
+ if ( outputFile.exists() && !overwrite )
{
return;
}
- FileWriter w = new FileWriter( new File( project.getBasedir(), DEFAULT_BUILD_FILENAME ) );
+ String encoding = "UTF-8";
+
+ OutputStreamWriter w = new OutputStreamWriter( new FileOutputStream( outputFile ), encoding );
- XMLWriter writer = new PrettyPrintXMLWriter( w, StringUtils.repeat( " ", DEFAULT_INDENTATION_SIZE ), "UTF-8",
+ XMLWriter writer = new PrettyPrintXMLWriter( w, StringUtils.repeat( " ", DEFAULT_INDENTATION_SIZE ), encoding,
null );
// ----------------------------------------------------------------------
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 47/48: o ignored Eclipse settings
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 9fd9fda3d84c5956bffea1cd868cbf30bd4c9014
Author: Vincent Siveton <vs...@apache.org>
AuthorDate: Tue May 20 00:33:43 2008 +0000
o ignored Eclipse settings
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@658058 13f79535-47bb-0310-9956-ffa450edef68
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 16/48: o Added svn:eol-style=native
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 7a39f78cc7e4fd2afaab60aba3754c62ed00193b
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 13:42:22 2008 +0000
o Added svn:eol-style=native
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639638 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/ear-it/verify.bsh | 322 +++++++++++++++----------------
src/it/plugin-it/verify.bsh | 64 +++---
src/it/webapp-it/verify.bsh | 64 +++---
src/test/resources/unit/ant-test/pom.xml | 114 +++++------
4 files changed, 282 insertions(+), 282 deletions(-)
diff --git a/src/it/ear-it/verify.bsh b/src/it/ear-it/verify.bsh
index e364317..d25f40b 100644
--- a/src/it/ear-it/verify.bsh
+++ b/src/it/ear-it/verify.bsh
@@ -1,161 +1,161 @@
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-
-import org.codehaus.plexus.util.IOUtil;
-
-File build;
-File mavenBuild;
-File mavenBuildProperties;
-
-// Root project
-
-build = new File( basedir, "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir, "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-// EAR project
-
-build = new File( basedir + "/ear", "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir + "/ear", "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuildProperties = new File( basedir + "/ear", "maven-build.properties" );
-if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
-{
- System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-// EJBS project
-
-build = new File( basedir + "/ejbs", "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir + "/ejbs", "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuildProperties = new File( basedir + "/ejbs", "maven-build.properties" );
-if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
-{
- System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-// PRImARY-SOURCE project
-
-build = new File( basedir + "/primary-source", "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir + "/primary-source", "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuildProperties = new File( basedir + "/primary-source", "maven-build.properties" );
-if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
-{
- System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-// PROJECTS project
-
-build = new File( basedir + "/projects", "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir + "/projects", "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-// LOGGING project
-
-build = new File( basedir + "/projects/logging", "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir + "/projects/logging", "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuildProperties = new File( basedir + "/projects/logging", "maven-build.properties" );
-if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
-{
- System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-// SERVLETS project
-
-build = new File( basedir + "/servlets", "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir + "/servlets", "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-// SERVLET project
-
-build = new File( basedir + "/servlets/servlet", "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir + "/servlets/servlet", "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuildProperties = new File( basedir + "/servlets/servlet", "maven-build.properties" );
-if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
-{
- System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-return true;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+
+import org.codehaus.plexus.util.IOUtil;
+
+File build;
+File mavenBuild;
+File mavenBuildProperties;
+
+// Root project
+
+build = new File( basedir, "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir, "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+// EAR project
+
+build = new File( basedir + "/ear", "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir + "/ear", "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuildProperties = new File( basedir + "/ear", "maven-build.properties" );
+if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
+{
+ System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+// EJBS project
+
+build = new File( basedir + "/ejbs", "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir + "/ejbs", "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuildProperties = new File( basedir + "/ejbs", "maven-build.properties" );
+if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
+{
+ System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+// PRImARY-SOURCE project
+
+build = new File( basedir + "/primary-source", "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir + "/primary-source", "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuildProperties = new File( basedir + "/primary-source", "maven-build.properties" );
+if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
+{
+ System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+// PROJECTS project
+
+build = new File( basedir + "/projects", "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir + "/projects", "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+// LOGGING project
+
+build = new File( basedir + "/projects/logging", "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir + "/projects/logging", "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuildProperties = new File( basedir + "/projects/logging", "maven-build.properties" );
+if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
+{
+ System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+// SERVLETS project
+
+build = new File( basedir + "/servlets", "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir + "/servlets", "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+// SERVLET project
+
+build = new File( basedir + "/servlets/servlet", "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir + "/servlets/servlet", "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuildProperties = new File( basedir + "/servlets/servlet", "maven-build.properties" );
+if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
+{
+ System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+return true;
diff --git a/src/it/plugin-it/verify.bsh b/src/it/plugin-it/verify.bsh
index 9ab46b7..0df8538 100644
--- a/src/it/plugin-it/verify.bsh
+++ b/src/it/plugin-it/verify.bsh
@@ -1,32 +1,32 @@
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-
-import org.codehaus.plexus.util.IOUtil;
-
-File build;
-File mavenBuild;
-File mavenBuildProperties;
-
-// Plugin project
-
-build = new File( basedir, "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir, "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuildProperties = new File( basedir, "maven-build.properties" );
-if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
-{
- System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-return true;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+
+import org.codehaus.plexus.util.IOUtil;
+
+File build;
+File mavenBuild;
+File mavenBuildProperties;
+
+// Plugin project
+
+build = new File( basedir, "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir, "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuildProperties = new File( basedir, "maven-build.properties" );
+if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
+{
+ System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+return true;
diff --git a/src/it/webapp-it/verify.bsh b/src/it/webapp-it/verify.bsh
index ae12bda..f002a32 100644
--- a/src/it/webapp-it/verify.bsh
+++ b/src/it/webapp-it/verify.bsh
@@ -1,32 +1,32 @@
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-
-import org.codehaus.plexus.util.IOUtil;
-
-File build;
-File mavenBuild;
-File mavenBuildProperties;
-
-// Webapp project
-
-build = new File( basedir, "build.xml" );
-if ( build.isDirectory() || !build.exists() )
-{
- System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuild = new File( basedir, "maven-build.xml" );
-if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
-{
- System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-mavenBuildProperties = new File( basedir, "maven-build.properties" );
-if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
-{
- System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
- return false;
-}
-
-return true;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+
+import org.codehaus.plexus.util.IOUtil;
+
+File build;
+File mavenBuild;
+File mavenBuildProperties;
+
+// Webapp project
+
+build = new File( basedir, "build.xml" );
+if ( build.isDirectory() || !build.exists() )
+{
+ System.err.println( "The file '" + build.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuild = new File( basedir, "maven-build.xml" );
+if ( mavenBuild.isDirectory() || !mavenBuild.exists() )
+{
+ System.err.println( "The file '" + mavenBuild.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+mavenBuildProperties = new File( basedir, "maven-build.properties" );
+if ( mavenBuildProperties.isDirectory() || !mavenBuildProperties.exists() )
+{
+ System.err.println( "The file '" + mavenBuildProperties.getAbsolutePath() + "' is a directory or doesn't exist." );
+ return false;
+}
+
+return true;
diff --git a/src/test/resources/unit/ant-test/pom.xml b/src/test/resources/unit/ant-test/pom.xml
index cff0734..3e33c1d 100644
--- a/src/test/resources/unit/ant-test/pom.xml
+++ b/src/test/resources/unit/ant-test/pom.xml
@@ -1,57 +1,57 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-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.
--->
-
-<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">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.plugins.maven-ant-plugin.unit</groupId>
- <artifactId>ant-test</artifactId>
- <packaging>jar</packaging>
- <version>1.0-SNAPSHOT</version>
- <inceptionYear>2006</inceptionYear>
- <name>Maven Ant Plugin Test</name>
- <url>http://maven.apache.org</url>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-ant-plugin</artifactId>
- <configuration>
- <project implementation="org.apache.maven.plugin.ant.stubs.AntTestMavenProjectStub"/>
- <settings implementation="org.apache.maven.plugin.ant.stubs.SettingsStub"/>
- <localRepository>${localRepository}</localRepository>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <myKey>myValue</myKey>
- </properties>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.unit</groupId>
+ <artifactId>ant-test</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <inceptionYear>2006</inceptionYear>
+ <name>Maven Ant Plugin Test</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <configuration>
+ <project implementation="org.apache.maven.plugin.ant.stubs.AntTestMavenProjectStub"/>
+ <settings implementation="org.apache.maven.plugin.ant.stubs.SettingsStub"/>
+ <localRepository>${localRepository}</localRepository>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <myKey>myValue</myKey>
+ </properties>
+</project>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 26/48: [MANT-4] Generated ANT contains hardcoded
"get" tasks that look at the "C:\" drive etc... when using a local
repository
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit d60798d504818181d13b948d4450bf3f6a65a652
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 01:19:37 2008 +0000
[MANT-4] Generated ANT contains hardcoded "get" tasks that look at the "C:\" drive etc... when using a local repository
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639932 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/file-repo-it/goals.txt | 2 +
src/it/file-repo-it/pom.xml | 62 ++++++++++++++++++++++
src/it/file-repo-it/verify.bsh | 38 +++++++++++++
.../apache/maven/plugin/ant/AntBuildWriter.java | 38 ++++++++++---
4 files changed, 133 insertions(+), 7 deletions(-)
diff --git a/src/it/file-repo-it/goals.txt b/src/it/file-repo-it/goals.txt
new file mode 100644
index 0000000..16cd63b
--- /dev/null
+++ b/src/it/file-repo-it/goals.txt
@@ -0,0 +1,2 @@
+ant:ant
+initialize
diff --git a/src/it/file-repo-it/pom.xml b/src/it/file-repo-it/pom.xml
new file mode 100644
index 0000000..fe639c9
--- /dev/null
+++ b/src/it/file-repo-it/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.it</groupId>
+ <artifactId>file-repo-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <version>@pom.version@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="help" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>repo0</id>
+ <url>file://localhost/${basedir}</url>
+ </repository>
+ <repository>
+ <id>repo1</id>
+ <url>file://${basedir}/repo1</url>
+ </repository>
+ <repository>
+ <id>repo2</id>
+ <url>file://${basedir}/repo2/</url>
+ </repository>
+ </repositories>
+
+</project>
diff --git a/src/it/file-repo-it/verify.bsh b/src/it/file-repo-it/verify.bsh
new file mode 100644
index 0000000..803ca53
--- /dev/null
+++ b/src/it/file-repo-it/verify.bsh
@@ -0,0 +1,38 @@
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+import org.codehaus.plexus.util.*;
+
+try
+{
+ File buildFile = new File( basedir, "maven-build.xml" );
+ String xml = FileUtils.fileRead( buildFile, "UTF-8" );
+
+ Matcher m0 = Pattern.compile( "<copy\\s+file\\s*=\\s*\\Q\"junit/junit/3.8.2/junit-3.8.2.jar\"\\E" ).matcher( xml );
+ if ( !m0.find() )
+ {
+ System.err.println( "Build script does not contain <copy> for local artifacts from repo0." );
+ return false;
+ }
+
+ Matcher m1 = Pattern.compile( "<copy\\s+file\\s*=\\s*\\Q\"repo1/junit/junit/3.8.2/junit-3.8.2.jar\"\\E" ).matcher( xml );
+ if ( !m1.find() )
+ {
+ System.err.println( "Build script does not contain <copy> for local artifacts from repo1." );
+ return false;
+ }
+
+ Matcher m2 = Pattern.compile( "<copy\\s+file\\s*=\\s*\\Q\"repo2/junit/junit/3.8.2/junit-3.8.2.jar\"\\E" ).matcher( xml );
+ if ( !m2.find() )
+ {
+ System.err.println( "Build script does not contain <copy> for local artifacts from repo2." );
+ return false;
+ }
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index a81e456..6d1164b 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -1144,6 +1144,8 @@ public class AntBuildWriter
writer.addAttribute( "dir", "${maven.repo.local}" );
writer.endElement(); // mkdir
+ String basedir = project.getBasedir().getAbsolutePath();
+
// TODO: proxy - probably better to use wagon!
for ( Iterator i = project.getTestArtifacts().iterator(); i.hasNext(); )
{
@@ -1166,13 +1168,35 @@ public class AntBuildWriter
for ( Iterator j = project.getRepositories().iterator(); j.hasNext(); )
{
Repository repository = (Repository) j.next();
-
- writer.startElement( "get" );
- writer.addAttribute( "src", repository.getUrl() + "/" + path );
- AntBuildWriterUtil.addWrapAttribute( writer, "get", "dest", "${maven.repo.local}/" + path, 3 );
- AntBuildWriterUtil.addWrapAttribute( writer, "get", "usetimestamp", "false", 3 );
- AntBuildWriterUtil.addWrapAttribute( writer, "get", "ignoreerrors", "true", 3 );
- writer.endElement(); // get
+ String url = repository.getUrl();
+
+ if ( url.regionMatches( true, 0, "file:", 0, 5 ) && url.indexOf( basedir ) > 0 )
+ {
+ url = url.substring( url.indexOf( basedir ) + basedir.length() );
+ if ( url.startsWith( "/" ) )
+ {
+ url = url.substring( 1 );
+ }
+ if ( !url.endsWith( "/" ) && url.length() > 0 )
+ {
+ url += '/';
+ }
+
+ writer.startElement( "copy" );
+ writer.addAttribute( "file", url + path );
+ AntBuildWriterUtil.addWrapAttribute( writer, "copy", "tofile", "${maven.repo.local}/" + path, 3 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "copy", "failonerror", "false", 3 );
+ writer.endElement(); // copy
+ }
+ else
+ {
+ writer.startElement( "get" );
+ writer.addAttribute( "src", url + '/' + path );
+ AntBuildWriterUtil.addWrapAttribute( writer, "get", "dest", "${maven.repo.local}/" + path, 3 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "get", "usetimestamp", "false", 3 );
+ AntBuildWriterUtil.addWrapAttribute( writer, "get", "ignoreerrors", "true", 3 );
+ writer.endElement(); // get
+ }
}
}
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 05/48: o forced IT o added repo1 for IT test
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 46ed54c99f7c5429749e2bd75de779521572ad2b
Author: Vincent Siveton <vs...@apache.org>
AuthorDate: Thu Aug 23 01:26:15 2007 +0000
o forced IT
o added repo1 for IT test
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@568793 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
src/it/plugin-it/pom.xml | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 322a2a0..332635a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -142,8 +142,8 @@ under the License.
<id>integration-tests</id>
<activation>
<property>
- <name>integration-tests</name>
- <value>true</value>
+ <name>maven.test.skip</name>
+ <value>!true</value>
</property>
</activation>
<build>
diff --git a/src/it/plugin-it/pom.xml b/src/it/plugin-it/pom.xml
index e883aae..232e13d 100644
--- a/src/it/plugin-it/pom.xml
+++ b/src/it/plugin-it/pom.xml
@@ -46,6 +46,17 @@ under the License.
<enabled>true</enabled>
</snapshots>
</repository>
+ <repository>
+ <id>repo1</id>
+ <name>Maven2</name>
+ <url>http://repo1.maven.org/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
</repositories>
<!-- No Plugin Snapshot -->
@@ -61,6 +72,17 @@ under the License.
<enabled>false</enabled>
</snapshots>
</pluginRepository>
+ <pluginRepository>
+ <id>repo1</id>
+ <name>Maven2</name>
+ <url>http://repo1.maven.org/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
</pluginRepositories>
<dependencies>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 25/48: o Adjusted IT due to r639886
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit a7787a446b7d2c23e66f7bfcf99f4520435146e5
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 23:08:41 2008 +0000
o Adjusted IT due to r639886
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639904 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/encoding-it/pom.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/it/encoding-it/pom.xml b/src/it/encoding-it/pom.xml
index fcfb7f1..eae8a56 100644
--- a/src/it/encoding-it/pom.xml
+++ b/src/it/encoding-it/pom.xml
@@ -27,7 +27,8 @@
<configuration>
<tasks>
<!-- delete the properties file to prevent fallback, we want only stuff from the XML file -->
- <delete file="${basedir}/maven-build.properties"/>
+ <delete file="${basedir}/maven-build.properties" />
+ <property name="maven.repo.local" location="${settings.localRepository}" />
<ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
</tasks>
</configuration>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 29/48: [MANT-40] Use includes/excludes
configured for Surefire when running tests
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit ef4a0118560d602f856564480718e365e7312f8b
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Mar 22 13:12:36 2008 +0000
[MANT-40] Use includes/excludes configured for Surefire when running tests
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639990 13f79535-47bb-0310-9956-ffa450edef68
---
src/it/test-custom-selector-it/goals.txt | 2 +
src/it/test-custom-selector-it/pom.xml | 79 ++++++++++++++++++++++
.../src/test/java/it/BadTest.java | 37 ++++++++++
.../src/test/java/it/BrokenTest.java | 37 ++++++++++
.../src/test/java/it/ExcludedTestCase.java | 37 ++++++++++
.../src/test/java/it/GoodTest.java | 37 ++++++++++
.../src/test/java/it/TestExcluded.java | 37 ++++++++++
src/it/test-custom-selector-it/verify.bsh | 23 +++++++
src/it/test-default-selector-it/goals.txt | 2 +
src/it/test-default-selector-it/pom.xml | 66 ++++++++++++++++++
.../src/test/java/it/AbstractTest.java | 37 ++++++++++
.../src/test/java/it/GoodTest.java | 37 ++++++++++
.../src/test/java/it/GoodTestCase.java | 37 ++++++++++
.../src/test/java/it/TestGood.java | 37 ++++++++++
src/it/test-default-selector-it/verify.bsh | 41 +++++++++++
.../apache/maven/plugin/ant/AntBuildWriter.java | 57 ++++++++++++++--
.../maven/plugin/ant/AntBuildWriterUtil.java | 45 ++++++++++++
17 files changed, 641 insertions(+), 7 deletions(-)
diff --git a/src/it/test-custom-selector-it/goals.txt b/src/it/test-custom-selector-it/goals.txt
new file mode 100644
index 0000000..16cd63b
--- /dev/null
+++ b/src/it/test-custom-selector-it/goals.txt
@@ -0,0 +1,2 @@
+ant:ant
+initialize
diff --git a/src/it/test-custom-selector-it/pom.xml b/src/it/test-custom-selector-it/pom.xml
new file mode 100644
index 0000000..3597c78
--- /dev/null
+++ b/src/it/test-custom-selector-it/pom.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.it</groupId>
+ <artifactId>test-custom-selector-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <version>@pom.version@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.2</version>
+ <configuration>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/Bad*.java</exclude>
+ <exclude>**/Broken*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <build.compiler>extJavac</build.compiler>
+ </properties>
+
+</project>
diff --git a/src/it/test-custom-selector-it/src/test/java/it/BadTest.java b/src/it/test-custom-selector-it/src/test/java/it/BadTest.java
new file mode 100644
index 0000000..447024f
--- /dev/null
+++ b/src/it/test-custom-selector-it/src/test/java/it/BadTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class BadTest
+ extends TestCase
+{
+
+ public void testFail()
+ throws Exception
+ {
+ fail( "This test should have been excluded." );
+ }
+
+}
diff --git a/src/it/test-custom-selector-it/src/test/java/it/BrokenTest.java b/src/it/test-custom-selector-it/src/test/java/it/BrokenTest.java
new file mode 100644
index 0000000..297ac41
--- /dev/null
+++ b/src/it/test-custom-selector-it/src/test/java/it/BrokenTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class BrokenTest
+ extends TestCase
+{
+
+ public void testFail()
+ throws Exception
+ {
+ fail( "This test should have been excluded." );
+ }
+
+}
diff --git a/src/it/test-custom-selector-it/src/test/java/it/ExcludedTestCase.java b/src/it/test-custom-selector-it/src/test/java/it/ExcludedTestCase.java
new file mode 100644
index 0000000..458f0a3
--- /dev/null
+++ b/src/it/test-custom-selector-it/src/test/java/it/ExcludedTestCase.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class ExcludedTestCase
+ extends TestCase
+{
+
+ public void testFail()
+ throws Exception
+ {
+ fail( "This test should have been excluded." );
+ }
+
+}
diff --git a/src/it/test-custom-selector-it/src/test/java/it/GoodTest.java b/src/it/test-custom-selector-it/src/test/java/it/GoodTest.java
new file mode 100644
index 0000000..c6f6032
--- /dev/null
+++ b/src/it/test-custom-selector-it/src/test/java/it/GoodTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class GoodTest
+ extends TestCase
+{
+
+ public void testPass()
+ throws Exception
+ {
+ assertTrue( true );
+ }
+
+}
diff --git a/src/it/test-custom-selector-it/src/test/java/it/TestExcluded.java b/src/it/test-custom-selector-it/src/test/java/it/TestExcluded.java
new file mode 100644
index 0000000..8567c6d
--- /dev/null
+++ b/src/it/test-custom-selector-it/src/test/java/it/TestExcluded.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class TestExcluded
+ extends TestCase
+{
+
+ public void testFail()
+ throws Exception
+ {
+ fail( "This test should have been excluded." );
+ }
+
+}
diff --git a/src/it/test-custom-selector-it/verify.bsh b/src/it/test-custom-selector-it/verify.bsh
new file mode 100644
index 0000000..c993878
--- /dev/null
+++ b/src/it/test-custom-selector-it/verify.bsh
@@ -0,0 +1,23 @@
+import java.io.*;
+import java.util.*;
+
+try
+{
+ File reportDir = new File( basedir, "target/test-reports" );
+
+ {
+ File file = new File( reportDir, "TEST-it.GoodTest.xml" );
+ if ( !file.isFile() )
+ {
+ System.err.println( "Report file does not exist: " + file );
+ return false;
+ }
+ }
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/src/it/test-default-selector-it/goals.txt b/src/it/test-default-selector-it/goals.txt
new file mode 100644
index 0000000..16cd63b
--- /dev/null
+++ b/src/it/test-default-selector-it/goals.txt
@@ -0,0 +1,2 @@
+ant:ant
+initialize
diff --git a/src/it/test-default-selector-it/pom.xml b/src/it/test-default-selector-it/pom.xml
new file mode 100644
index 0000000..30b173c
--- /dev/null
+++ b/src/it/test-default-selector-it/pom.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugins.maven-ant-plugin.it</groupId>
+ <artifactId>test-default-selector-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ant-plugin</artifactId>
+ <version>@pom.version@</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <phase>initialize</phase>
+ <configuration>
+ <tasks>
+ <ant dir="${basedir}" antfile="${basedir}/build.xml" target="package" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <!-- use default values for surefire includes/excludes -->
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <build.compiler>extJavac</build.compiler>
+ </properties>
+
+</project>
diff --git a/src/it/test-default-selector-it/src/test/java/it/AbstractTest.java b/src/it/test-default-selector-it/src/test/java/it/AbstractTest.java
new file mode 100644
index 0000000..710a0c9
--- /dev/null
+++ b/src/it/test-default-selector-it/src/test/java/it/AbstractTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public abstract class AbstractTest
+ extends TestCase
+{
+
+ public void testFail()
+ throws Exception
+ {
+ fail( "This test should have been excluded." );
+ }
+
+}
diff --git a/src/it/test-default-selector-it/src/test/java/it/GoodTest.java b/src/it/test-default-selector-it/src/test/java/it/GoodTest.java
new file mode 100644
index 0000000..c6f6032
--- /dev/null
+++ b/src/it/test-default-selector-it/src/test/java/it/GoodTest.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class GoodTest
+ extends TestCase
+{
+
+ public void testPass()
+ throws Exception
+ {
+ assertTrue( true );
+ }
+
+}
diff --git a/src/it/test-default-selector-it/src/test/java/it/GoodTestCase.java b/src/it/test-default-selector-it/src/test/java/it/GoodTestCase.java
new file mode 100644
index 0000000..eeacb43
--- /dev/null
+++ b/src/it/test-default-selector-it/src/test/java/it/GoodTestCase.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class GoodTestCase
+ extends TestCase
+{
+
+ public void testPass()
+ throws Exception
+ {
+ assertTrue( true );
+ }
+
+}
diff --git a/src/it/test-default-selector-it/src/test/java/it/TestGood.java b/src/it/test-default-selector-it/src/test/java/it/TestGood.java
new file mode 100644
index 0000000..eb61ac5
--- /dev/null
+++ b/src/it/test-default-selector-it/src/test/java/it/TestGood.java
@@ -0,0 +1,37 @@
+package it;
+
+/*
+ * 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 junit.framework.TestCase;
+
+/**
+ * @version $Id$
+ */
+public class TestGood
+ extends TestCase
+{
+
+ public void testPass()
+ throws Exception
+ {
+ assertTrue( true );
+ }
+
+}
diff --git a/src/it/test-default-selector-it/verify.bsh b/src/it/test-default-selector-it/verify.bsh
new file mode 100644
index 0000000..1422080
--- /dev/null
+++ b/src/it/test-default-selector-it/verify.bsh
@@ -0,0 +1,41 @@
+import java.io.*;
+import java.util.*;
+
+try
+{
+ File reportDir = new File( basedir, "target/test-reports" );
+
+ {
+ File file = new File( reportDir, "TEST-it.GoodTest.xml" );
+ if ( !file.isFile() )
+ {
+ System.err.println( "Report file does not exist: " + file );
+ return false;
+ }
+ }
+
+ {
+ File file = new File( reportDir, "TEST-it.GoodTestCase.xml" );
+ if ( !file.isFile() )
+ {
+ System.err.println( "Report file does not exist: " + file );
+ return false;
+ }
+ }
+
+ {
+ File file = new File( reportDir, "TEST-it.TestGood.xml" );
+ if ( !file.isFile() )
+ {
+ System.err.println( "Report file does not exist: " + file );
+ return false;
+ }
+ }
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+return true;
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index 561f7a0..ac9cab6 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -23,6 +23,8 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -744,6 +746,7 @@ public class AntBuildWriter
* @param testCompileSourceRoots
*/
private void writeTestTargets( XMLWriter writer, List testCompileSourceRoots )
+ throws IOException
{
AntBuildWriterUtil.writeCommentText( writer, "Run all tests", 1 );
@@ -812,18 +815,27 @@ public class AntBuildWriter
writer.startElement( "batchtest" );
writer.addAttribute( "todir", "${maven.test.reports}" );
+ List includes =
+ getSelectorList( AntBuildWriterUtil.getMavenSurefirePluginOptions( project, "includes", null ) );
+ if ( includes == null || includes.isEmpty() )
+ {
+ includes = Arrays.asList( new String[] { "**/Test*.java", "**/*Test.java", "**/*TestCase.java" } );
+ }
+
+ List excludes =
+ getSelectorList( AntBuildWriterUtil.getMavenSurefirePluginOptions( project, "excludes", null ) );
+ if ( excludes == null || excludes.isEmpty() )
+ {
+ excludes = Arrays.asList( new String[] { "**/*Abstract*Test.java" } );
+ }
+
String[] compileSourceRoots = (String[]) testCompileSourceRoots.toArray( new String[0] );
for ( int i = 0; i < compileSourceRoots.length; i++ )
{
writer.startElement( "fileset" );
writer.addAttribute( "dir", "${maven.build.testDir." + i + "}" );
- /* TODO: need to get these from the test plugin somehow?
- UnitTest unitTest = project.getBuild().getUnitTest();
- writeIncludesExcludes( writer, unitTest.getIncludes(), unitTest.getExcludes() );
- // TODO: m1 allows additional test exclusions via maven.ant.excludeTests
- */
- AntBuildWriterUtil.writeIncludesExcludes( writer, Collections.singletonList( "**/*Test.java" ),
- Collections.singletonList( "**/*Abstract*Test.java" ) );
+ // TODO: m1 allows additional test exclusions via maven.ant.excludeTests
+ AntBuildWriterUtil.writeIncludesExcludes( writer, includes, excludes );
writer.endElement(); // fileset
}
writer.endElement(); // batchtest
@@ -1265,4 +1277,35 @@ public class AntBuildWriter
return sb.toString();
}
+
+ /**
+ * Flattens the specified file selector options into a simple string list. For instance, the input
+ *
+ * <pre>
+ * [ {include="*Test.java"}, {include="*TestCase.java"} ]
+ * </pre>
+ *
+ * is converted to
+ *
+ * <pre>
+ * [ "*Test.java", "*TestCase.java" ]
+ * </pre>
+ *
+ * @param options The file selector options to flatten, may be <code>null</code>.
+ * @return The string list, might be empty but never <code>null</code>.
+ */
+ private static List getSelectorList( Map[] options )
+ {
+ List list = new ArrayList();
+ if ( options != null && options.length > 0 )
+ {
+ for ( int i = 0; i < options.length; i++ )
+ {
+ Map option = options[i];
+ list.addAll( option.values() );
+ }
+ }
+ return list;
+ }
+
}
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
index df4b066..bb5a2b0 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
@@ -779,6 +779,51 @@ public class AntBuildWriterUtil
}
/**
+ * Return the <code>optionName</code> value defined in a project for the "maven-surefire-plugin" plugin.
+ *
+ * @param project not null
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the value for the option name or the default value. Could be null if not found.
+ * @throws IOException if any
+ */
+ public static String getMavenSurefirePluginBasicOption( MavenProject project, String optionName, String defaultValue )
+ throws IOException
+ {
+ return getMavenPluginBasicOption( project, "maven-surefire-plugin", optionName, defaultValue );
+ }
+
+ /**
+ * Return the map of <code>optionName</code> value defined in a project for the "maven-surefire-plugin" plugin.
+ *
+ * @param project not null
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the map for the option name or the default value. Could be null if not found.
+ * @throws IOException if any
+ */
+ public static Map getMavenSurefirePluginOption( MavenProject project, String optionName, String defaultValue )
+ throws IOException
+ {
+ return getMavenPluginOption( project, "maven-surefire-plugin", optionName, defaultValue );
+ }
+
+ /**
+ * Return an array of map of <code>optionName</code> value defined in a project for the "maven-surefire-plugin" plugin.
+ *
+ * @param project not null
+ * @param optionName the option name wanted
+ * @param defaultValue a default value
+ * @return the array of option name or the default value. Could be null if not found.
+ * @throws IOException if any
+ */
+ public static Map[] getMavenSurefirePluginOptions( MavenProject project, String optionName, String defaultValue )
+ throws IOException
+ {
+ return getMavenPluginOptions( project, "maven-surefire-plugin", optionName, defaultValue );
+ }
+
+ /**
* Return the <code>optionName</code> value defined in a project for the "maven-javadoc-plugin" plugin.
*
* @param project not null
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 43/48: o Updated to wagon-provider-api:1.0-beta-2
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit f95a5509b6478093a4b6d3a4b7758d2a80fe904f
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Sat Apr 19 11:52:43 2008 +0000
o Updated to wagon-provider-api:1.0-beta-2
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@649801 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 17ebbe6..c4f01a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -63,14 +63,13 @@ under the License.
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
- <version>1.0-alpha-6</version>
+ <version>1.0-beta-2</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0.2</version>
</dependency>
- <!-- For Maven 2.0.4 -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 10/48: work around bug in old versions of xalan
bundled in JDK 1.4.2
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit daf94c9f806624daac8a6e97776c9561e439c2b7
Author: Brett Leslie Porter <br...@apache.org>
AuthorDate: Mon Oct 29 08:43:13 2007 +0000
work around bug in old versions of xalan bundled in JDK 1.4.2
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@589544 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
index 241655e..a2b24b7 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
@@ -1089,7 +1089,7 @@ public class AntBuildWriterUtil
XObject obj = XPathAPI.eval( doc, "//configuration/" + optionName );
NodeList nodeList = obj.nodelist();
- if ( isList( nodeList.item( 0 ) ) )
+ if ( nodeList.getLength() > 0 && isList( nodeList.item( 0 ) ) )
{
/*
* <optionNames>
@@ -1182,7 +1182,6 @@ public class AntBuildWriterUtil
}
catch ( Exception e )
{
- e.printStackTrace();
throw new IOException( "Exception occured: " + e.getMessage() );
}
}
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 03/48: Readd license header lost in release
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit abe9e709e14cbeb6ede69d560c59dc0c5c9a4aee
Author: Carlos Sanchez Gonzalez <ca...@apache.org>
AuthorDate: Fri May 18 17:13:25 2007 +0000
Readd license header lost in release
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@539525 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index dd9e758..322a2a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,27 @@
-<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">
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<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">
<parent>
<artifactId>maven-plugins</artifactId>
<groupId>org.apache.maven.plugins</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 18/48: [MANT-37] Wrong path to test resources in
maven-build.xml
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 228327bd57db05750532ffe40f4b13b9c040fe56
Author: Benjamin Bentmann <be...@apache.org>
AuthorDate: Fri Mar 21 15:47:27 2008 +0000
[MANT-37] Wrong path to test resources in maven-build.xml
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@639680 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
index 8d80613..c111fcb 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriter.java
@@ -390,7 +390,7 @@ public class AntBuildWriter
// TODO: optional in m1
// TODO: USD properties
- AntBuildWriterUtil.writeCommentText( writer, "Build environnement properties", 1 );
+ AntBuildWriterUtil.writeCommentText( writer, "Build environment properties", 1 );
// ----------------------------------------------------------------------
// File properties to override local properties
@@ -470,9 +470,9 @@ public class AntBuildWriter
}
}
- if ( project.getBuild().getResources() != null )
+ if ( project.getBuild().getTestResources() != null )
{
- Resource[] array = (Resource[]) project.getBuild().getResources().toArray( new Resource[0] );
+ Resource[] array = (Resource[]) project.getBuild().getTestResources().toArray( new Resource[0] );
for ( int i = 0; i < array.length; i++ )
{
writer.startElement( "property" );
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 44/48: o Update links to Doxia APT reference.
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit a2d362c4ae99504ef3fd1075727e90bde1ab631c
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sun May 18 16:59:37 2008 +0000
o Update links to Doxia APT reference.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@657584 13f79535-47bb-0310-9956-ffa450edef68
---
src/site/apt/examples/customize.apt | 2 +-
src/site/apt/examples/fail-missing-junit.apt | 2 +-
src/site/apt/examples/run-single-test.apt | 2 +-
src/site/apt/examples/skip-tests.apt | 2 +-
src/site/apt/index.apt | 2 +-
src/site/apt/usage.apt | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/site/apt/examples/customize.apt b/src/site/apt/examples/customize.apt
index c1ddca3..d0a9347 100644
--- a/src/site/apt/examples/customize.apt
+++ b/src/site/apt/examples/customize.apt
@@ -21,7 +21,7 @@
~~ limitations under the License.
~~ NOTE: For help with the syntax of this file, see:
- ~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+ ~~ http://maven.apache.org/doxia/references/apt-format.html
Customizing Generated Ant Build Files
diff --git a/src/site/apt/examples/fail-missing-junit.apt b/src/site/apt/examples/fail-missing-junit.apt
index f09460c..079d86f 100644
--- a/src/site/apt/examples/fail-missing-junit.apt
+++ b/src/site/apt/examples/fail-missing-junit.apt
@@ -21,7 +21,7 @@
~~ limitations under the License.
~~ NOTE: For help with the syntax of this file, see:
- ~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+ ~~ http://maven.apache.org/doxia/references/apt-format.html
Failing the Build if JUnit is Missing
diff --git a/src/site/apt/examples/run-single-test.apt b/src/site/apt/examples/run-single-test.apt
index d55da8c..51e3133 100644
--- a/src/site/apt/examples/run-single-test.apt
+++ b/src/site/apt/examples/run-single-test.apt
@@ -21,7 +21,7 @@
~~ limitations under the License.
~~ NOTE: For help with the syntax of this file, see:
- ~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+ ~~ http://maven.apache.org/doxia/references/apt-format.html
Running Individual Unit Tests
diff --git a/src/site/apt/examples/skip-tests.apt b/src/site/apt/examples/skip-tests.apt
index 1824f79..7af0975 100644
--- a/src/site/apt/examples/skip-tests.apt
+++ b/src/site/apt/examples/skip-tests.apt
@@ -21,7 +21,7 @@
~~ limitations under the License.
~~ NOTE: For help with the syntax of this file, see:
- ~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+ ~~ http://maven.apache.org/doxia/references/apt-format.html
Skipping Unit Tests
diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt
index e093219..683fe7a 100644
--- a/src/site/apt/index.apt
+++ b/src/site/apt/index.apt
@@ -21,7 +21,7 @@
~~ limitations under the License.
~~ NOTE: For help with the syntax of this file, see:
- ~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+ ~~ http://maven.apache.org/doxia/references/apt-format.html
Maven 2 Ant Plugin
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index af8ac75..7197ff3 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -21,7 +21,7 @@
~~ limitations under the License.
~~ NOTE: For help with the syntax of this file, see:
- ~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+ ~~ http://maven.apache.org/doxia/references/apt-format.html
Usage
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.
[maven-ant-plugin] 14/48: [MANT-30] classcast exception when
running ant:ant on tagtraum.com's gcviewer project Submitted by: Patrick
Huber Reviewed by: Dennis Lundberg
Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to annotated tag maven-ant-plugin-2.1
in repository https://gitbox.apache.org/repos/asf/maven-ant-plugin.git
commit 719d59865defd6ab19e1438058512939ea4fefa6
Author: Dennis Lundberg <de...@apache.org>
AuthorDate: Sun Jan 6 18:14:24 2008 +0000
[MANT-30] classcast exception when running ant:ant on tagtraum.com's gcviewer project
Submitted by: Patrick Huber
Reviewed by: Dennis Lundberg
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin@609362 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
index a2b24b7..a214eb8 100644
--- a/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
+++ b/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java
@@ -569,7 +569,7 @@ public class AntBuildWriterUtil
}
addWrapAttribute( writer, "jar", "basedir", "${maven.build.outputDir}", 3 );
addWrapAttribute( writer, "jar", "excludes", "**/package.html", 3 );
- if ( getMavenJarPluginBasicOption( project, "archive//manifest", null ) != null )
+ if ( getMavenPluginOption( project, "maven-jar-plugin", "archive//manifest", null ) != null )
{
writer.startElement( "manifest" );
writer.startElement( "attribute" );
--
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.