You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2008/08/03 15:20:28 UTC
svn commit: r682165 - in
/maven/plugins/branches/maven-site-plugin-doxia-beta-1: ./
src/it/MSITE-265/ src/main/java/org/apache/maven/plugins/site/
src/main/resources/ src/site/apt/ src/site/xdoc/
Author: ltheussl
Date: Sun Aug 3 06:20:27 2008
New Revision: 682165
URL: http://svn.apache.org/viewvc?rev=682165&view=rev
Log:
Merging changes from trunk (662546:680678)
Modified:
maven/plugins/branches/maven-site-plugin-doxia-beta-1/pom.xml
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/it/MSITE-265/pom.xml
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_ca.properties
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_sv.properties
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_tr.properties
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/apt/index.apt
maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/xdoc/i18n.xml
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/pom.xml?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/pom.xml (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/pom.xml Sun Aug 3 06:20:27 2008
@@ -19,18 +19,17 @@
-->
<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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
- <version>10</version>
+ <version>11</version>
</parent>
+ <modelVersion>4.0.0</modelVersion>
<artifactId>maven-site-plugin</artifactId>
- <version>2.0-beta-8-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Maven Site Plugin</name>
+ <version>2.0-beta-8-SNAPSHOT</version>
<description>
The Maven Site Plugin is a plugin that generates a site for the current project.
</description>
@@ -148,6 +147,102 @@
<url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/</url>
</scm>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!-- TODO: remove when maven-plugins parent pom 12 is released -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>2.4.2</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>maven.test.skip</name>
+ <value>!true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>1.2.1-SNAPSHOT</version>
+ <configuration>
+ <projectsDirectory>src/it</projectsDirectory>
+ <pomIncludes>
+ <pomInclude>**/**/pom.xml</pomInclude>
+ </pomIncludes>
+ <postBuildHookScript>verify.bsh</postBuildHookScript>
+ <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
+ <goals>
+ <goal>clean</goal>
+ <goal>${project.groupId}:${project.artifactId}:${project.version}:site</goal>
+ </goals>
+ <settingsFile>src/it/settings.xml</settingsFile>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>reporting</id>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>l10n-maven-plugin</artifactId>
+ <version>1.0-alpha-1</version>
+ <configuration>
+ <locales>
+ <locale>ca</locale>
+ <locale>cs</locale>
+ <locale>da</locale>
+ <locale>de</locale>
+ <locale>es</locale>
+ <locale>fr</locale>
+ <locale>hu</locale>
+ <locale>it</locale>
+ <locale>ja</locale>
+ <locale>ko</locale>
+ <locale>nl</locale>
+ <locale>no</locale>
+ <locale>pl</locale>
+ <locale>pt_BR</locale>
+ <locale>sk</locale>
+ <locale>sv</locale>
+ <locale>tr</locale>
+ <locale>zh_CN</locale>
+ </locales>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ </profiles>
+
<dependencies>
<!-- Maven -->
<dependency>
@@ -249,7 +344,7 @@
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-doxia-tools</artifactId>
- <version>1.0</version>
+ <version>1.0.1</version>
</dependency>
<!-- Wagon -->
@@ -295,101 +390,16 @@
<!-- test -->
<dependency>
- <groupId>org.apache.maven.shared</groupId>
+ <groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>1.0-beta-1</version>
+ <version>1.2</version>
<scope>test</scope>
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.3</version>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
- <profile>
- <id>integration-tests</id>
- <activation>
- <property>
- <name>maven.test.skip</name>
- <value>!true</value>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-invoker-plugin</artifactId>
- <version>1.2</version>
- <configuration>
- <projectsDirectory>src/it</projectsDirectory>
- <pomIncludes>
- <pomInclude>**/**/pom.xml</pomInclude>
- </pomIncludes>
- <postBuildHookScript>verify.bsh</postBuildHookScript>
- <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
- <goals>
- <goal>clean</goal>
- <goal>${project.groupId}:${project.artifactId}:${project.version}:site</goal>
- </goals>
- <settingsFile>src/it/settings.xml</settingsFile>
- </configuration>
- <executions>
- <execution>
- <id>integration-test</id>
- <phase>integration-test</phase>
- <goals>
- <goal>install</goal>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
<properties>
<doxiaVersion>1.0-beta-1-SNAPSHOT</doxiaVersion>
<doxiaSitetoolsVersion>1.0-beta-1-SNAPSHOT</doxiaSitetoolsVersion>
- <wagonVersion>1.0-beta-2</wagonVersion>
+ <wagonVersion>1.0-beta-3</wagonVersion>
</properties>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>l10n-maven-plugin</artifactId>
- <version>1.0-alpha-1</version>
- <configuration>
- <locales>
- <locale>ca</locale>
- <locale>cs</locale>
- <locale>da</locale>
- <locale>de</locale>
- <locale>es</locale>
- <locale>fr</locale>
- <locale>hu</locale>
- <locale>it</locale>
- <locale>ja</locale>
- <locale>ko</locale>
- <locale>nl</locale>
- <locale>no</locale>
- <locale>pl</locale>
- <locale>pt_BR</locale>
- <locale>sk</locale>
- <locale>sv</locale>
- <locale>tr</locale>
- <locale>zh_CN</locale>
- </locales>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
</project>
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/it/MSITE-265/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/it/MSITE-265/pom.xml?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/it/MSITE-265/pom.xml (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/it/MSITE-265/pom.xml Sun Aug 3 06:20:27 2008
@@ -28,6 +28,7 @@
<name>MSITE-265 It</name>
<properties>
<currentVersion>2.0.7</currentVersion>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<reporting>
<plugins>
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.java Sun Aug 3 06:20:27 2008
@@ -223,7 +223,10 @@
DecorationModel decorationModel;
try
{
- decorationModel = siteTool.getDecorationModel( project, reactorProjects, localRepository, repositories, toRelative( project.getBasedir(), siteDirectory.getAbsolutePath() ), locale, getInputEncoding(), outputEncoding );
+ decorationModel = siteTool.getDecorationModel( project, reactorProjects, localRepository, repositories,
+ toRelative( project.getBasedir(),
+ siteDirectory.getAbsolutePath() ),
+ locale, getInputEncoding(), outputEncoding );
}
catch ( SiteToolException e )
{
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDeployMojo.java Sun Aug 3 06:20:27 2008
@@ -56,16 +56,18 @@
import org.codehaus.plexus.util.xml.Xpp3Dom;
import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
/**
- * Deploys the site using scp/file protocol.
- * For scp protocol, website files are packaged into zip archive,
+ * Deploys the generated site using <code>scp</code> or <code>file</code>
+ * protocol to the site specified in the
+ * <code><distributionManagement></code> section of the POM.
+ * <p>
+ * For <code>scp</code> protocol, the website files are packaged into zip archive,
* then the archive is transfered to the remote host, next it is un-archived.
* This method of deployment should normally be much faster
- * than making a file by file copy. For file protocol, the files are copied
+ * than making a file by file copy. For <code>file</code> protocol, the files are copied
* directly to the destination directory.
+ * </p>
*
* @author <a href="mailto:michal@org.codehaus.org">Michal Maczka</a>
* @version $Id$
@@ -266,20 +268,20 @@
String nonProxyHostPrefix = StringUtils.substringBefore( nonProxyHost, "*" );
String nonProxyHostSuffix = StringUtils.substringAfter( nonProxyHost, "*" );
// prefix*
- if ( StringUtils.isNotEmpty(nonProxyHostPrefix) && host.startsWith( nonProxyHostPrefix )
- && StringUtils.isEmpty(nonProxyHostSuffix) )
+ if ( StringUtils.isNotEmpty( nonProxyHostPrefix ) && host.startsWith( nonProxyHostPrefix )
+ && StringUtils.isEmpty( nonProxyHostSuffix ) )
{
return null;
}
// *suffix
- if ( StringUtils.isEmpty(nonProxyHostPrefix)
- && StringUtils.isNotEmpty(nonProxyHostSuffix) && host.endsWith( nonProxyHostSuffix ))
+ if ( StringUtils.isEmpty( nonProxyHostPrefix )
+ && StringUtils.isNotEmpty( nonProxyHostSuffix ) && host.endsWith( nonProxyHostSuffix ) )
{
return null;
}
// prefix*suffix
- if ( StringUtils.isNotEmpty(nonProxyHostPrefix) && host.startsWith( nonProxyHostPrefix )
- && StringUtils.isNotEmpty(nonProxyHostSuffix) && host.endsWith( nonProxyHostSuffix ))
+ if ( StringUtils.isNotEmpty( nonProxyHostPrefix ) && host.startsWith( nonProxyHostPrefix )
+ && StringUtils.isNotEmpty( nonProxyHostSuffix ) && host.endsWith( nonProxyHostSuffix ) )
{
return null;
}
@@ -303,7 +305,8 @@
* @param log
* @throws WagonConfigurationException
*/
- static void configureWagon( Wagon wagon, String repositoryId, Settings settings, PlexusContainer container, Log log )
+ static void configureWagon( Wagon wagon, String repositoryId, Settings settings, PlexusContainer container,
+ Log log )
throws WagonConfigurationException
{
// MSITE-25: Make sure that the server settings are inserted
@@ -326,11 +329,13 @@
}
catch ( final ComponentLookupException e )
{
- throw new WagonConfigurationException( repositoryId, "Unable to lookup wagon configurator. Wagon configuration cannot be applied.", e );
+ throw new WagonConfigurationException( repositoryId, "Unable to lookup wagon configurator."
+ + " Wagon configuration cannot be applied.", e );
}
catch ( ComponentConfigurationException e )
{
- throw new WagonConfigurationException( repositoryId, "Unable to apply wagon configuration.", e );
+ throw new WagonConfigurationException( repositoryId, "Unable to apply wagon configuration.",
+ e );
}
finally
{
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteDescriptorAttachMojo.java Sun Aug 3 06:20:27 2008
@@ -72,7 +72,9 @@
{
Locale locale = (Locale) iterator.next();
- File descriptorFile = siteTool.getSiteDescriptorFromBasedir( toRelative( project.getBasedir(), siteDirectory.getAbsolutePath() ), basedir, locale );
+ File descriptorFile = siteTool.getSiteDescriptorFromBasedir( toRelative( project.getBasedir(),
+ siteDirectory.getAbsolutePath() ),
+ basedir, locale );
if ( descriptorFile.exists() )
{
@@ -86,7 +88,8 @@
String siteDescriptorContent = IOUtil.toString( ReaderFactory.newXmlReader( descriptorFile ) );
siteDescriptorContent =
- siteTool.getInterpolatedSiteDescriptorContent( props, project, siteDescriptorContent, getInputEncoding(), outputEncoding );
+ siteTool.getInterpolatedSiteDescriptorContent( props, project, siteDescriptorContent,
+ getInputEncoding(), outputEncoding );
decoration = new DecorationXpp3Reader().read( new StringReader( siteDescriptorContent ) );
}
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteMojo.java?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteMojo.java (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteMojo.java Sun Aug 3 06:20:27 2008
@@ -34,7 +34,11 @@
import java.util.Map;
/**
- * Generates the project site.
+ * Generates the site for a single project.
+ * <p>
+ * Note that links between module sites in a multi module build will <b>not</b>
+ * work.
+ * </p>
*
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteRunMojo.java Sun Aug 3 06:20:27 2008
@@ -45,7 +45,8 @@
import org.mortbay.jetty.webapp.WebAppContext;
/**
- * Start the site up, rendering documents as requested for fast editing.
+ * Starts the site up, rendering documents as requested for faster editing.
+ * It uses Jetty as the web server.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
* @version $Id$
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageDeployMojo.java Sun Aug 3 06:20:27 2008
@@ -23,6 +23,7 @@
import org.apache.maven.artifact.manager.WagonManager;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
import org.apache.maven.wagon.ConnectionException;
import org.apache.maven.wagon.ResourceDoesNotExistException;
@@ -41,10 +42,13 @@
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import java.io.File;
+import java.util.List;
/**
- * Deploy a staging site in specific directory.
- * <p>Useful to test the generated site.</p>
+ * Deploys the generated site to a staging or mock directory on the site
+ * specified in the <code><distributionManagement></code> section of the
+ * POM. It also supports <code>scp</code> and <code>file</code> protocols for
+ * deployment.
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
@@ -55,9 +59,14 @@
extends SiteStageMojo implements Contextualizable
{
/**
- * Staging site URL to deploy the staging directory.
+ * The staged site will be deployed to this URL.
*
- * @parameter expression="${stagingSiteURL}" default-value="${project.distributionManagement.site.url}/staging"
+ * If you don't specify this, the default-value will be
+ * "${project.distributionManagement.site.url}/staging", where "project" is
+ * either the current project or, in a reactor build, the top level project
+ * in the reactor.
+ *
+ * @parameter expression="${stagingSiteURL}"
* @see <a href="http://maven.apache.org/maven-model/maven.html#class_site">MavenModel#class_site</a>
*/
private String stagingSiteURL;
@@ -78,7 +87,7 @@
private PlexusContainer container;
- private final String STAGING_SERVER_ID = "stagingSite";
+ private static final String STAGING_SERVER_ID = "stagingSite";
/**
* @see org.apache.maven.plugin.Mojo#execute()
@@ -102,6 +111,9 @@
private void deployStagingSite()
throws MojoExecutionException, MojoFailureException
{
+ stagingSiteURL = getStagingSiteURL( project, reactorProjects, stagingSiteURL );
+ getLog().info( "Using this URL for staging: " + stagingSiteURL );
+
Repository repository = new Repository( STAGING_SERVER_ID, stagingSiteURL );
Wagon wagon;
@@ -184,4 +196,63 @@
container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
+ /**
+ * Find the URL where staging will take place.
+ *
+ * @param currentProject The currently executing project
+ * @param reactorProjects The projects in the reactor
+ * @param usersStagingSiteURL The staging site URL as suggested by the user's configuration
+ * @return the site URL for staging
+ */
+ protected String getStagingSiteURL( MavenProject currentProject, List reactorProjects, String usersStagingSiteURL )
+ {
+ String topLevelURL = null;
+ String relative = "";
+
+ // If the user has specified a stagingSiteURL - use it
+ if ( usersStagingSiteURL != null )
+ {
+ getLog().debug( "stagingSiteURL specified by the user." );
+ topLevelURL = usersStagingSiteURL;
+ }
+ getLog().debug( "stagingSiteURL NOT specified by the user." );
+
+ // Find the top level project in the reactor
+ MavenProject topLevelProject = getTopLevelProject( reactorProjects );
+
+ // Take the distributionManagement site url from the top level project,
+ // if there is one, otherwise take it from the current project
+ if ( topLevelProject == null )
+ {
+ if ( topLevelURL == null )
+ {
+ // The user didn't specify a URL and there is no top level project in the reactor
+ // Use current project
+ getLog().debug( "No top level project found in the reactor, using the current project." );
+ topLevelURL =
+ currentProject.getDistributionManagement().getSite().getUrl() + "/" + DEFAULT_STAGING_DIRECTORY;
+ }
+ }
+ else
+ {
+ // Find the relative path between the parent and child distribution URLs, if any
+ relative = "/" + siteTool.getRelativePath( currentProject.getDistributionManagement().getSite().getUrl(),
+ topLevelProject.getDistributionManagement().getSite().getUrl() );
+
+ if ( topLevelURL == null )
+ {
+ // The user didn't specify a URL and there is a top level project in the reactor
+ // Use the top level project
+ getLog().debug( "Using the top level project found in the reactor." );
+ topLevelURL =
+ topLevelProject.getDistributionManagement().getSite().getUrl() + "/" + DEFAULT_STAGING_DIRECTORY;
+ }
+ }
+
+ // Return either
+ // usersURL + relative(from parent, to child)
+ // or
+ // topLevelProjectURL + staging + relative(from parent, to child)
+ return topLevelURL + relative;
+ }
}
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/java/org/apache/maven/plugins/site/SiteStageMojo.java Sun Aug 3 06:20:27 2008
@@ -29,10 +29,16 @@
import java.io.File;
import java.util.Iterator;
+import java.util.List;
/**
- * Staging a site in specific directory.
- * <p>Useful to test the generated site.</p>
+ * Generates a site in a local staging or mock directory based on the site url
+ * specified in the <code><distributionManagement></code> section of the
+ * POM.
+ * <p>
+ * It can be used to test that links between module sites in a multi module
+ * build works.
+ * </p>
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
@@ -42,11 +48,14 @@
public class SiteStageMojo
extends SiteMojo
{
+ protected static final String DEFAULT_STAGING_DIRECTORY = "staging";
+
/**
- * Staging directory location.
+ * Staging directory location. This needs to be an absolute path, like
+ * <code>C:\stagingArea\myProject\</code> on Windows or
+ * <code>/stagingArea/myProject/</code> on Unix.
*
- * @parameter expression="${stagingDirectory}" default-value="${project.build.directory}/staging"
- * @required
+ * @parameter expression="${stagingDirectory}"
*/
protected File stagingDirectory;
@@ -63,6 +72,9 @@
throw new MojoExecutionException( "Missing site information." );
}
+ stagingDirectory = getStagingDirectory( project, reactorProjects, stagingDirectory );
+ getLog().info( "Using this directory for staging: " + stagingDirectory );
+
outputDirectory = new File( stagingDirectory, structureProject );
// Safety
@@ -106,6 +118,67 @@
}
/**
+ * Find the directory where staging will take place.
+ *
+ * @param currentProject The currently executing project
+ * @param reactorProjects The projects in the reactor
+ * @param usersStagingDirectory The staging directory as suggested by the user's configuration
+ * @return the directory for staging
+ */
+ protected File getStagingDirectory( MavenProject currentProject, List reactorProjects, File usersStagingDirectory )
+ {
+ // Check if the user has specified a stagingDirectory
+ if ( usersStagingDirectory != null )
+ {
+ getLog().debug( "stagingDirectory specified by the user." );
+ return usersStagingDirectory;
+ }
+ getLog().debug( "stagingDirectory NOT specified by the user." );
+
+ // Find the top level project in the reactor
+ MavenProject topLevelProject = getTopLevelProject( reactorProjects );
+
+ // Use the top level project's build directory if there is one, otherwise use this project's build directory
+ File buildDirectory;
+ if ( topLevelProject == null )
+ {
+ getLog().debug( "No top level project found in the reactor, using the current project." );
+ buildDirectory = new File( currentProject.getBuild().getDirectory() );
+ }
+ else
+ {
+ getLog().debug( "Using the top level project found in the reactor." );
+ buildDirectory = new File( topLevelProject.getBuild().getDirectory() );
+ }
+
+ return new File( buildDirectory, DEFAULT_STAGING_DIRECTORY );
+ }
+
+ /**
+ * Find the top level parent in the reactor, i.e. the execution root.
+ *
+ * @param reactorProjects The projects in the reactor
+ * @return The top level project in the reactor, or <code>null</code> if none can be found
+ */
+ protected MavenProject getTopLevelProject( List reactorProjects )
+ {
+ MavenProject topLevelProject = null;
+ if ( reactorProjects != null )
+ {
+ Iterator iterator = reactorProjects.iterator();
+ while ( iterator.hasNext() )
+ {
+ MavenProject reactorProject = (MavenProject) iterator.next();
+ if ( reactorProject.isExecutionRoot() )
+ {
+ topLevelProject = reactorProject;
+ }
+ }
+ }
+ return topLevelProject;
+ }
+
+ /**
* Generates the site structure using the project hiearchy (project and its modules) or using the
* distributionManagement elements from the pom.xml.
*
@@ -119,12 +192,12 @@
{
if ( project.getDistributionManagement() == null )
{
- String hierarchy = project.getName();
+ String hierarchy = project.getArtifactId();
MavenProject parent = project.getParent();
while ( parent != null )
{
- hierarchy = parent.getName() + "/" + hierarchy;
+ hierarchy = parent.getArtifactId() + "/" + hierarchy;
parent = parent.getParent();
}
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_ca.properties
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_ca.properties?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_ca.properties (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_ca.properties Sun Aug 3 06:20:27 2008
@@ -15,12 +15,12 @@
# specific language governing permissions and limitations
# under the License.
-report.category.column.description = Descripció
+report.category.column.description = Descripci\u00f3
report.category.column.document = Document
report.category.sectionTitle = Resum
-report.information.description1 = Aquest document presenta un resum dels diferents documents i enllaços que són part de la informació general del projecte. Tot aquest contingut és generat automàticament per
+report.information.description1 = Aquest document presenta un resum dels diferents documents i enlla\u00e7os que s\u00f3n part de la informaci\u00f3 general del projecte. Tot aquest contingut \u00e9s generat autom\u00e0ticament per
report.information.description2 = en nom d'aquest projecte.
-report.information.title = Informació general del projecte
-report.project.description1 = Aquest document presenta un resum de diversos informes que són generats automàticament per
-report.project.description2 = Cada informe està descrit breument més endavant.
+report.information.title = Informaci\u00f3 general del projecte
+report.project.description1 = Aquest document presenta un resum de diversos informes que s\u00f3n generats autom\u00e0ticament per
+report.project.description2 = Cada informe est\u00e0 descrit breument m\u00e9s endavant.
report.project.title = Informes Generats per Maven
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_sv.properties
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_sv.properties?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_sv.properties (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_sv.properties Sun Aug 3 06:20:27 2008
@@ -17,10 +17,10 @@
report.category.column.description = Beskrivning
report.category.column.document = Dokument
-report.category.sectionTitle = Översikt
-report.information.description1 = Detta dokument ger en översikt över de dokument och länkar som utgör projektets generella information. Allt innehåll genereras automatiskt av
-report.information.description2 = åt projektet.
+report.category.sectionTitle = \u00d6versikt
+report.information.description1 = Detta dokument ger en \u00f6versikt \u00f6ver de dokument och l\u00e4nkar som utg\u00f6r projektets generella information. Allt inneh\u00e5ll genereras automatiskt av
+report.information.description2 = \u00e5t projektet.
report.information.title = Projektinformation
-report.project.description1 = Detta dokument ger en översikt över de rapporter som genereras av
+report.project.description1 = Detta dokument ger en \u00f6versikt \u00f6ver de rapporter som genereras av
report.project.description2 = Varje rapport beskrivs kort nedan.
report.project.title = Projektrapporter
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_tr.properties
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_tr.properties?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_tr.properties (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/main/resources/site-plugin_tr.properties Sun Aug 3 06:20:27 2008
@@ -15,12 +15,12 @@
# specific language governing permissions and limitations
# under the License.
-report.category.column.description = Taným
-report.category.column.document = Doküman
-report.category.sectionTitle = Genel Bakýþ
+report.category.column.description = Tan\u00fdm
+report.category.column.document = Dok\u00fcman
+report.category.sectionTitle = Genel Bak\u00fd\u00fe
report.information.description1 = This document provides an overview of the various documents and links that are part of this project's general information. All of this content is automatically generated by
report.information.description2 = on behalf of the project.
report.information.title = Proje Bilgileri
report.project.description1 = This document provides an overview of the various reports that are automatically generated by
report.project.description2 = Each report is briefly described below.
-report.project.title = Geliþtirilmiþ Raporlar
+report.project.title = Geli\u00fetirilmi\u00fe Raporlar
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/apt/index.apt?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/apt/index.apt (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/apt/index.apt Sun Aug 3 06:20:27 2008
@@ -36,25 +36,27 @@
The Site Plugin has seven goals:
- * {{{site-mojo.html}site:site}} is used generate a site for the project.
+ * {{{site-mojo.html}site:site}} is used generate a site for a single project.
+ Note that links between module sites in a multi module build will <<not>> work.
* {{{deploy-mojo.html}site:deploy}} is used to deploy the generated site using <<<scp>>> or <<<file>>> protocol to the site
specified in the <<<\<distributionManagement\>>>> section of the POM.
* {{{run-mojo.html}site:run}} starts the site up, rendering documents as requested for faster editing. It uses Jetty
- as the webapp server.
+ as the web server.
* {{{stage-mojo.html}site:stage}} generates a site in a local staging or mock directory based on the site url specified
- in the <<<\<distributionManagement\>>>> section of the POM.
+ in the <<<\<distributionManagement\>>>> section of the POM. It can be used
+ to test that links between module sites in a multi module build works.
- * {{{stage-deploy-mojo.html}site:stage-deploy}} deploys the generated site in a staging or mock directory on the site
- specified in the <<<\<distributionManagement\>>>> section of the POM. It also supports <<<scp>>> and <<<file>>> protocol for deployment.
+ * {{{stage-deploy-mojo.html}site:stage-deploy}} deploys the generated site to a staging or mock directory on the site
+ specified in the <<<\<distributionManagement\>>>> section of the POM. It also supports <<<scp>>> and <<<file>>> protocols for deployment.
* {{{attach-descriptor-mojo.html}site:attach-descriptor}} adds the site descriptor to the list of files to be
installed/deployed. For more references of the site descriptor,
{{{examples/sitedescriptor.html}here's a link}}.
- * {{{site-jar.html}site:jar}} is used to bundle the site output into a jar.
+ * {{{jar-mojo.html}site:jar}} is used to bundle the site output into a jar.
* Usage
Modified: maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/xdoc/i18n.xml
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/xdoc/i18n.xml?rev=682165&r1=682164&r2=682165&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/xdoc/i18n.xml (original)
+++ maven/plugins/branches/maven-site-plugin-doxia-beta-1/src/site/xdoc/i18n.xml Sun Aug 3 06:20:27 2008
@@ -115,7 +115,7 @@
N/A
</td>
<td>
- N/A
+ <a href="http://svn.apache.org/repos/asf/maven/shared/trunk/maven-doxia-tools/src/main/resources/site-tool_da.properties">See</a>
</td>
</tr>
<tr>
@@ -373,6 +373,9 @@
<b>Tools to convert a file from one encoding to another encoding</b>:
Unix <i>iconv</i> command, Notepad++.
</li>
+ <li>
+ <b>IDE plugins</b>: <a href="http://propedit.sourceforge.jp/index_en.html">Properties Editor Eclipse Plugin</a>.
+ </li>
</ul>
</p>
<p>