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:36 UTC
[maven-ant-plugin] 27/48: [MANT-38] Use reporting output directory
configured in POM
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>.