mirror of https://github.com/apache/maven.git
o clean import
o Use MavenProject instead of Model for obtain more informations git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@170954 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ae40e024d2
commit
6ffcf006fb
|
@ -124,7 +124,9 @@ public class DoxiaMojo
|
|||
|
||||
MavenReportConfiguration config = new MavenReportConfiguration();
|
||||
|
||||
config.setModel( project.getModel() );
|
||||
config.setProject( project );
|
||||
|
||||
config.setReportOutputDirectory( new File( outputDirectory ) );
|
||||
|
||||
//Generate reports
|
||||
if ( reports != null )
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-model</artifactId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -17,10 +17,7 @@ package org.apache.maven.reporting;
|
|||
*/
|
||||
|
||||
import org.codehaus.doxia.sink.Sink;
|
||||
import org.codehaus.doxia.module.xdoc.XdocSink;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,6 @@ package org.apache.maven.reporting;
|
|||
|
||||
import org.codehaus.doxia.sink.Sink;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.apache.maven.reporting;
|
|||
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.model.Scm;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
@ -28,10 +29,22 @@ import java.util.List;
|
|||
*/
|
||||
public class MavenReportConfiguration
|
||||
{
|
||||
private Model model;
|
||||
private MavenProject project;
|
||||
|
||||
private File basedir;
|
||||
|
||||
private File outputDirectory;
|
||||
|
||||
public void setReportOutputDirectory( File outputDirectory )
|
||||
{
|
||||
this.outputDirectory = outputDirectory;
|
||||
}
|
||||
|
||||
public File getReportOutputDirectory()
|
||||
{
|
||||
return outputDirectory;
|
||||
}
|
||||
|
||||
public File getBasedir()
|
||||
{
|
||||
return basedir;
|
||||
|
@ -44,17 +57,17 @@ public class MavenReportConfiguration
|
|||
|
||||
public Model getModel()
|
||||
{
|
||||
if ( model == null )
|
||||
{
|
||||
model = new Model();
|
||||
}
|
||||
|
||||
return model;
|
||||
return project.getModel();
|
||||
}
|
||||
|
||||
public void setModel( Model model )
|
||||
public void setProject( MavenProject project )
|
||||
{
|
||||
this.model = model;
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
public MavenProject getProject()
|
||||
{
|
||||
return project;
|
||||
}
|
||||
|
||||
public List getDependencies()
|
||||
|
@ -87,6 +100,11 @@ public class MavenReportConfiguration
|
|||
getModel().getBuild().setSourceDirectory( sourceDirectory );
|
||||
}
|
||||
|
||||
public List getCompileSourceRoots()
|
||||
{
|
||||
return project.getCompileSourceRoots();
|
||||
}
|
||||
|
||||
public String getScriptSourceDirectory()
|
||||
{
|
||||
return getModel().getBuild().getScriptSourceDirectory();
|
||||
|
@ -106,4 +124,10 @@ public class MavenReportConfiguration
|
|||
{
|
||||
getModel().getBuild().setTestSourceDirectory( testSourceDirectory );
|
||||
}
|
||||
|
||||
public List getTestCompileSourceRoots()
|
||||
{
|
||||
return project.getTestCompileSourceRoots();
|
||||
}
|
||||
|
||||
}
|
|
@ -16,8 +16,6 @@ package org.apache.maven.reporting;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.codehaus.doxia.sink.Sink;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||
* @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
|
||||
|
|
|
@ -86,7 +86,7 @@ public class CheckstyleReportMojo
|
|||
{
|
||||
MavenReportConfiguration config = new MavenReportConfiguration();
|
||||
|
||||
config.setModel( project.getModel() );
|
||||
config.setProject( project );
|
||||
|
||||
MavenReport report = new CheckstyleReport();
|
||||
|
||||
|
|
|
@ -85,7 +85,9 @@ public class PmdReportMojo
|
|||
{
|
||||
MavenReportConfiguration config = new MavenReportConfiguration();
|
||||
|
||||
config.setModel( project.getModel() );
|
||||
config.setProject( project );
|
||||
|
||||
config.setReportOutputDirectory( new File( outputDirectory ) );
|
||||
|
||||
MavenReport report = new PmdReport();
|
||||
|
||||
|
|
|
@ -85,7 +85,9 @@ public class ProjectReportsMojo
|
|||
{
|
||||
MavenReportConfiguration config = new MavenReportConfiguration();
|
||||
|
||||
config.setModel( project.getModel() );
|
||||
config.setProject( project );
|
||||
|
||||
config.setReportOutputDirectory( new File( outputDirectory ) );
|
||||
|
||||
MavenReport dependenciesReport = new DependenciesReport();
|
||||
|
||||
|
|
Loading…
Reference in New Issue