diff --git a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java index 6cecda4244..4f728507fd 100644 --- a/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java +++ b/maven-plugins/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/XdocGeneratorMojo.java @@ -30,7 +30,7 @@ public class XdocGeneratorMojo extends AbstractGeneratorMojo { /** - * @parameter expression="${project.build.directory}/generated-xdocs" + * @parameter expression="${project.build.directory}/generated-site/xdoc" * @required */ protected File outputDirectory; diff --git a/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java b/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java index 87f6cb46c7..5a2314a944 100644 --- a/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java +++ b/maven-plugins/maven-site-plugin/src/main/java/org/apache/maven/doxia/DoxiaMojo.java @@ -27,6 +27,7 @@ import org.codehaus.doxia.site.renderer.SiteRenderer; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringInputStream; import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.IOUtil; import java.util.ArrayList; import java.io.File; @@ -60,7 +61,7 @@ public class DoxiaMojo private String siteDirectory; /** - * @parameter alias="workingDirectory" expression="${project.build.directory}/site-generated" + * @parameter alias="workingDirectory" expression="${project.build.directory}/generated-site" * @required */ private String generatedSiteDirectory; @@ -125,8 +126,6 @@ public class DoxiaMojo config.setModel( project.getModel() ); - config.setOutputDirectory( new File( generatedSiteDirectory ) ); - //Generate reports if ( reports != null ) { @@ -157,7 +156,6 @@ public class DoxiaMojo } catch ( Exception e ) { - e.printStackTrace(); throw new MojoExecutionException( "An error is occurred in project info page generation.", e ); } } @@ -170,7 +168,6 @@ public class DoxiaMojo } catch ( Exception e ) { - e.printStackTrace(); throw new MojoExecutionException( "An error is occurred in project reports page generation.", e ); } } @@ -254,16 +251,18 @@ public class DoxiaMojo { File siteDescriptor = new File( siteDirectory, "site.xml" ); - if ( !siteDescriptor.exists() ) - { - throw new MojoExecutionException( "The site descriptor is not present!" ); - } - String siteDescriptorContent = ""; try { - siteDescriptorContent = FileUtils.fileRead( siteDescriptor ); + if ( siteDescriptor.exists() ) + { + siteDescriptorContent = FileUtils.fileRead( siteDescriptor ); + } + else + { + siteDescriptorContent = IOUtil.toString( getClass().getResourceAsStream( "/default-site.xml" ) ); + } } catch( IOException e ) { @@ -277,8 +276,12 @@ public class DoxiaMojo props.put( "reports", getReportsMenu() ); } + // TODO: interpolate ${project.*} in general + props.put( "project.name", project.getName() ); + props.put( "project.url", project.getUrl() ); + siteDescriptorContent = StringUtils.interpolate( siteDescriptorContent, props ); - + return new StringInputStream( siteDescriptorContent ); } diff --git a/maven-plugins/maven-site-plugin/src/main/resources/default-site.xml b/maven-plugins/maven-site-plugin/src/main/resources/default-site.xml new file mode 100644 index 0000000000..3fa181c80a --- /dev/null +++ b/maven-plugins/maven-site-plugin/src/main/resources/default-site.xml @@ -0,0 +1,12 @@ + + + + ${project.name} + + + + + + ${reports} + + diff --git a/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/MavenReportConfiguration.java b/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/MavenReportConfiguration.java index b838aa7d8d..f9e219a28f 100644 --- a/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/MavenReportConfiguration.java +++ b/maven-reporting/maven-reporting-api/src/main/java/org/apache/maven/reporting/MavenReportConfiguration.java @@ -30,20 +30,8 @@ public class MavenReportConfiguration { private Model model; - private File outputDirectory; - private File basedir; - public File getOutputDirectory() - { - return outputDirectory; - } - - public void setOutputDirectory( File outputDirectory ) - { - this.outputDirectory = outputDirectory; - } - public File getBasedir() { return basedir; diff --git a/maven-site/pom.xml b/maven-site/pom.xml index 956954d75d..f072c23ab0 100644 --- a/maven-site/pom.xml +++ b/maven-site/pom.xml @@ -12,7 +12,7 @@ website - scp://minotaur.apache.org/x1/home/jvanzyl/public_html/m2-new + scp://people.apache.org/home/brett/public_html/maven-stage-site/maven2 diff --git a/sandbox/maven-reports/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportMojo.java b/sandbox/maven-reports/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportMojo.java index 6f8001a77e..8b98567434 100644 --- a/sandbox/maven-reports/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportMojo.java +++ b/sandbox/maven-reports/maven-pmd-plugin/src/main/java/org/apache/maven/plugin/pmd/PmdReportMojo.java @@ -87,8 +87,6 @@ public class PmdReportMojo config.setModel( project.getModel() ); - config.setOutputDirectory( new File( outputDirectory ) ); - MavenReport report = new PmdReport(); report.setConfiguration( config );