maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r359750 - in /maven/plugins/trunk/maven-site-plugin: ./ src/main/java/org/apache/maven/plugins/site/ src/main/resources/org/apache/maven/plugins/site/ src/main/resources/org/apache/maven/plugins/site/css/ src/main/resources/org/apache/maven...
Date Thu, 29 Dec 2005 07:16:01 GMT
Author: brett
Date: Wed Dec 28 23:15:32 2005
New Revision: 359750

URL: http://svn.apache.org/viewcvs?rev=359750&view=rev
Log:
implement skinning
PR: MSITE-48


Added:
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm
  (contents, props changed)
      - copied, changed from r358740, maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm
Removed:
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/css/maven-classic.css
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/css/maven-theme.css
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/add.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/external-classic.png
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/external.png
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/file.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/fix.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/folder-closed.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/folder-open.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/help_logo.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_alert.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_alertsml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowfolder1_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowfolder2_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowfolderclosed1_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowfolderopen2_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowmembers1_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowmembers2_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowusergroups1_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowusergroups2_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowwaste1_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_arrowwaste2_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_confirmsml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_doc_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_doc_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_error_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_error_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_folder_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_folder_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_help_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_help_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_info_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_info_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_infosml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_members_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_members_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_sortdown.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_sortleft.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_sortright.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_sortup.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_success_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_success_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_usergroups_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_usergroups_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_warning_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_warning_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_waste_lrg.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/icon_waste_sml.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/newwindow-classic.png
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/newwindow.png
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/none.png
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_maj.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_maj_hi.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_maj_rond.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_med.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_med_hi.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_med_rond.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_min.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_min_036.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/nw_min_hi.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/pdf.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/poweredby_036.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/product_logo.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/remove.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/se_maj_rond.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/strich.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/sw_maj_rond.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/sw_med_rond.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/sw_min.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/images/update.gif
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm
Modified:
    maven/plugins/trunk/maven-site-plugin/pom.xml
    maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
    maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/resources.txt
    maven/plugins/trunk/maven-site-plugin/src/test/projects/site-plugin-test10/pom.xml

Modified: maven/plugins/trunk/maven-site-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/pom.xml?rev=359750&r1=359749&r2=359750&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-site-plugin/pom.xml Wed Dec 28 23:15:32 2005
@@ -54,6 +54,11 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+      <version>2.0.2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
     </dependency>
     <dependency>

Modified: maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java?rev=359750&r1=359749&r2=359750&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/java/org/apache/maven/plugins/site/SiteMojo.java
Wed Dec 28 23:15:32 2005
@@ -22,8 +22,11 @@
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.doxia.module.xdoc.XdocSiteModule;
 import org.apache.maven.doxia.site.decoration.DecorationModel;
+import org.apache.maven.doxia.site.decoration.Skin;
 import org.apache.maven.doxia.site.decoration.inheritance.DecorationModelInheritanceAssembler;
 import org.apache.maven.doxia.site.decoration.io.xpp3.DecorationXpp3Reader;
 import org.apache.maven.doxia.siterenderer.Renderer;
@@ -36,6 +39,7 @@
 import org.apache.maven.reporting.MavenReport;
 import org.apache.maven.reporting.MavenReportException;
 import org.codehaus.plexus.util.DirectoryScanner;
+import org.codehaus.plexus.util.Expand;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
@@ -78,7 +82,7 @@
 {
     private static final String RESOURCE_DIR = "org/apache/maven/plugins/site";
 
-    private static final String DEFAULT_TEMPLATE = RESOURCE_DIR + "/maven-site.vm";
+    private static final String DEFAULT_TEMPLATE = RESOURCE_DIR + "/default-site.vm";
 
     /**
      * Alternative directory for xdoc source, useful for m1 to m2 migration
@@ -195,7 +199,7 @@
     /**
      * The local repository.
      *
-     * @parameter expression="${localRepository}
+     * @parameter expression="${localRepository}"
      */
     private ArtifactRepository localRepository;
 
@@ -415,7 +419,7 @@
                     }
                 }
 
-                copyResources( outputDirectory );
+                copyResources( outputDirectory, decoration );
 
                 // Copy site resources
                 if ( resourcesDirectory != null && resourcesDirectory.exists() )
@@ -548,7 +552,7 @@
         }
 
         MavenProject parentProject = project.getParent();
-        if ( ( parentProject != null ) && ( project.getUrl() != null ) &&
( parentProject.getUrl() != null ) )
+        if ( parentProject != null && project.getUrl() != null && parentProject.getUrl()
!= null )
         {
             props.put( "parentProject", getProjectParentMenu( locale ) );
 
@@ -1111,11 +1115,12 @@
      * Copy Resources
      *
      * @param outputDir the output directory
+     * @param decoration
      * @throws IOException if any
      * @todo move to skin functionality in site renderer
      */
-    private void copyResources( File outputDir )
-        throws IOException
+    private void copyResources( File outputDir, DecorationModel decoration )
+        throws IOException, MojoFailureException, MojoExecutionException
     {
         InputStream resourceList = getStream( RESOURCE_DIR + "/resources.txt" );
 
@@ -1152,6 +1157,53 @@
 
                 line = reader.readLine();
             }
+        }
+
+        Skin skin = decoration.getSkin();
+
+        if ( skin == null )
+        {
+            skin = Skin.getDefaultSkin();
+        }
+
+        String version = skin.getVersion();
+        Artifact artifact;
+        try
+        {
+            if ( version == null )
+            {
+                version = Artifact.RELEASE_VERSION;
+            }
+            VersionRange versionSpec = VersionRange.createFromVersionSpec( version );
+            artifact = artifactFactory.createDependencyArtifact( skin.getGroupId(), skin.getArtifactId(),
versionSpec,
+                                                                 "jar", null, null );
+
+            artifactResolver.resolve( artifact, repositories, localRepository );
+        }
+        catch ( InvalidVersionSpecificationException e )
+        {
+            throw new MojoFailureException( "The skin version '" + version + "' is not valid:
" + e.getMessage() );
+        }
+        catch ( ArtifactResolutionException e )
+        {
+            throw new MojoExecutionException( "Unable to find skin", e );
+        }
+        catch ( ArtifactNotFoundException e )
+        {
+            throw new MojoFailureException( "The skin does not exist: " + e.getMessage()
);
+        }
+
+        try
+        {
+            Expand expand = new Expand();
+            expand.setSrc( artifact.getFile() );
+            expand.setDest( outputDir );
+            expand.setOverwrite( true );
+            expand.execute();
+        }
+        catch ( Exception e )
+        {
+            throw new MojoExecutionException( "Error expanding skin", e );
         }
     }
 

Copied: maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm
(from r358740, maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm)
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm?p2=maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm&p1=maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/maven-site.vm&r1=358740&r2=359750&rev=359750&view=diff
==============================================================================
    (empty)

Propchange: maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/default-site.vm
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/resources.txt
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/resources.txt?rev=359750&r1=359749&r2=359750&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/resources.txt
(original)
+++ maven/plugins/trunk/maven-site-plugin/src/main/resources/org/apache/maven/plugins/site/resources.txt
Wed Dec 28 23:15:32 2005
@@ -1,75 +1,5 @@
-images/nw_maj_rond.gif
 images/expanded.gif
-images/icon_arrowfolderopen2_sml.gif
-images/se_maj_rond.gif
-images/icon_folder_lrg.gif
-images/icon_help_lrg.gif
-images/sw_med_rond.gif
-images/external.png
-images/icon_waste_sml.gif
-images/icon_sortup.gif
-images/newwindow-classic.png
-images/icon_error_sml.gif
-images/icon_info_sml.gif
-images/remove.gif
-images/file.gif
-images/folder-closed.gif
-images/icon_infosml.gif
-images/nw_med.gif
-images/pdf.gif
-images/icon_arrowfolderclosed1_sml.gif
-images/nw_maj_hi.gif
-images/icon_folder_sml.gif
-images/product_logo.gif
-images/icon_members_lrg.gif
 images/collapsed.gif
-images/nw_min_hi.gif
-images/help_logo.gif
-images/update.gif
-images/none.png
-images/icon_arrowmembers1_sml.gif
-images/icon_sortleft.gif
-images/icon_arrowmembers2_sml.gif
-images/nw_maj.gif
-images/icon_help_sml.gif
-images/icon_alert.gif
-images/nw_min_036.gif
-images/external-classic.png
-images/icon_warning_lrg.gif
-images/icon_doc_lrg.gif
-images/icon_success_lrg.gif
-images/nw_min.gif
-images/icon_arrowfolder1_sml.gif
-images/icon_usergroups_lrg.gif
-images/icon_arrowfolder2_sml.gif
-images/nw_med_rond.gif
-images/strich.gif
-images/icon_sortright.gif
-images/icon_arrowwaste1_sml.gif
-images/sw_maj_rond.gif
-images/icon_arrowwaste2_sml.gif
-images/icon_members_sml.gif
-images/icon_usergroups_sml.gif
-images/icon_confirmsml.gif
-images/fix.gif
-images/icon_sortdown.gif
-images/add.gif
-images/icon_doc_sml.gif
-images/poweredby_036.gif
-images/icon_warning_sml.gif
-images/nw_med_hi.gif
-images/icon_success_sml.gif
-images/icon_alertsml.gif
-images/sw_min.gif
-images/icon_waste_lrg.gif
 images/logos/maven-feather.png
-images/icon_arrowusergroups1_sml.gif
-images/icon_arrowusergroups2_sml.gif
-images/newwindow.png
-images/icon_error_lrg.gif
-images/icon_info_lrg.gif
-images/folder-open.gif
 css/maven-base.css
 css/print.css
-css/maven-theme.css
-css/maven-classic.css

Modified: maven/plugins/trunk/maven-site-plugin/src/test/projects/site-plugin-test10/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-site-plugin/src/test/projects/site-plugin-test10/pom.xml?rev=359750&r1=359749&r2=359750&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/test/projects/site-plugin-test10/pom.xml (original)
+++ maven/plugins/trunk/maven-site-plugin/src/test/projects/site-plugin-test10/pom.xml Wed
Dec 28 23:15:32 2005
@@ -58,7 +58,7 @@
        <configuration> 
           
         <templateDirectory>${basedir}</templateDirectory> 
-         <template>maven-site.vm</template> 
+         <template>default-site.vm</template> 
        </configuration> 
       </plugin> 
     </plugins> 



Mime
View raw message