You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2021/06/04 17:48:15 UTC

[maven-doxia-sitetools] branch DOXIASITETOOLS-230 updated (c0f11c7 -> 1c3f224)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch DOXIASITETOOLS-230
in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git.


 discard c0f11c7  WIP - add plexus-oss reop
 discard 1b82464  [DOXIASITETOOLS-230] Upgrade to Velocity Engine 2.0
     new e28038e  [DOXIASITETOOLS-230] Upgrade to Velocity Engine 2.0
     new 1c3f224  use Plexus snapshot repo - waiting for release

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (c0f11c7)
            \
             N -- N -- N   refs/heads/DOXIASITETOOLS-230 (1c3f224)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 2 ++
 1 file changed, 2 insertions(+)

[maven-doxia-sitetools] 02/02: use Plexus snapshot repo - waiting for release

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch DOXIASITETOOLS-230
in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git

commit 1c3f224e6bd29cd0c29c05e9ad2b2326e93299d4
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Fri Jun 4 18:23:11 2021 +0200

    use Plexus snapshot repo - waiting for release
---
 pom.xml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/pom.xml b/pom.xml
index b973a50..7035392 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,6 +74,16 @@ under the License.
     <project.build.outputTimestamp>2020-02-19T07:03:09Z</project.build.outputTimestamp>
   </properties>
 
+  <repositories>
+    <repository>
+      <id>plexus-oss</id>
+      <url>https://oss.sonatype.org/service/local/repositories/plexus-snapshots/content/</url>
+      <snapshots><enabled>true</enabled></snapshots>
+      <releases><enabled>false</enabled>
+      </releases>
+    </repository>
+  </repositories>
+
   <dependencyManagement>
     <dependencies>
       <!-- doxia -->

[maven-doxia-sitetools] 01/02: [DOXIASITETOOLS-230] Upgrade to Velocity Engine 2.0

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch DOXIASITETOOLS-230
in repository https://gitbox.apache.org/repos/asf/maven-doxia-sitetools.git

commit e28038e79e406ec1571adbf14867e279ca0bb698
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Fri Jun 4 19:36:56 2021 +0200

    [DOXIASITETOOLS-230] Upgrade to Velocity Engine 2.0
    
    - update plexus-velocity to 1.3
    - update Velocity Tools to 3.0
---
 doxia-doc-renderer/pom.xml                         |  14 +--
 .../docrenderer/AbstractDocumentRenderer.java      |   7 +-
 doxia-site-renderer/pom.xml                        |  44 ++------
 .../doxia/siterenderer/SkinResourceLoader.java     | 125 ---------------------
 .../doxia/siterenderer/SkinResourceLoaderTest.java |  63 -----------
 .../src/test/resources/log4j.properties            |  24 ----
 pom.xml                                            |  24 +++-
 7 files changed, 38 insertions(+), 263 deletions(-)

diff --git a/doxia-doc-renderer/pom.xml b/doxia-doc-renderer/pom.xml
index da2a5bd..a94fa0a 100644
--- a/doxia-doc-renderer/pom.xml
+++ b/doxia-doc-renderer/pom.xml
@@ -114,19 +114,17 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-velocity</artifactId>
-      <version>1.2</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.codehaus.plexus</groupId>
-          <artifactId>plexus-component-api</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
 
     <!-- misc -->
     <dependency>
       <groupId>org.apache.velocity</groupId>
-      <artifactId>velocity</artifactId>
+      <artifactId>velocity-engine-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</scope>
     </dependency>
 
     <!-- misc -->
diff --git a/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java b/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
index bc9f7e5..4674def 100644
--- a/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
+++ b/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
@@ -59,7 +59,6 @@ import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.xml.XmlStreamReader;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import org.codehaus.plexus.velocity.SiteResourceLoader;
 import org.codehaus.plexus.velocity.VelocityComponent;
 
 /**
@@ -512,7 +511,7 @@ public abstract class AbstractDocumentRenderer
                     {
                         reader = getVelocityReader( f, ( (XmlStreamReader) reader ).getEncoding(), context );
                     }
-                    if ( context != null && Boolean.TRUE.equals( (Boolean) context.get( "validate" ) ) )
+                    if ( context != null && Boolean.TRUE.equals( context.get( "validate" ) ) )
                     {
                         reader = validate( reader, fullDocPath );
                     }
@@ -668,8 +667,8 @@ public abstract class AbstractDocumentRenderer
         {
             getLogger().debug( "Velocity render for " + f.getAbsolutePath() );
         }
-
-        SiteResourceLoader.setResource( f.getAbsolutePath() );
+// TODO
+//        SiteResourceLoader.setResource( f.getAbsolutePath() );
 
         Context velocityContext = new VelocityContext();
 
diff --git a/doxia-site-renderer/pom.xml b/doxia-site-renderer/pom.xml
index ba4c0f6..8246b1b 100644
--- a/doxia-site-renderer/pom.xml
+++ b/doxia-site-renderer/pom.xml
@@ -124,44 +124,11 @@ under the License.
     <!-- misc -->
     <dependency>
       <groupId>org.apache.velocity</groupId>
-      <artifactId>velocity</artifactId>
+      <artifactId>velocity-engine-core</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.velocity</groupId>
-      <artifactId>velocity-tools</artifactId>
-      <version>2.0</version>
-      <exclusions>
-        <!-- exclude VelocityView and VelocityStruts specific dependencies -->
-        <exclusion>
-          <groupId>javax.servlet</groupId>
-          <artifactId>servlet-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.struts</groupId>
-          <artifactId>struts-core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.struts</groupId>
-          <artifactId>struts-taglib</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.struts</groupId>
-          <artifactId>struts-tiles</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>sslext</groupId>
-          <artifactId>sslext</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>commons-validator</groupId>
-          <artifactId>commons-validator</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>commons-collections</groupId>
-      <artifactId>commons-collections</artifactId>
-      <version>3.2.2</version>
+      <groupId>org.apache.velocity.tools</groupId>
+      <artifactId>velocity-tools-generic</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.commons</groupId>
@@ -181,6 +148,11 @@ under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-core</artifactId>
       <version>${doxiaVersion}</version>
diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SkinResourceLoader.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SkinResourceLoader.java
deleted file mode 100644
index e8870de..0000000
--- a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/SkinResourceLoader.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.apache.maven.doxia.siterenderer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.velocity.runtime.resource.Resource;
-import org.apache.velocity.runtime.resource.loader.ResourceLoader;
-import org.apache.velocity.exception.ResourceNotFoundException;
-import org.apache.commons.collections.ExtendedProperties;
-import org.codehaus.plexus.util.IOUtil;
-
-/**
- * Skin resource loader: gets content from context classloader, which should contain skin artifact,
- * and normalizes newlines
- * (see <a href="https://issues.apache.org/jira/browse/DOXIASITETOOLS-87">DOXIASITETOOLS-87</a>).
- *
- * @author Hervé Boutemy
- */
-@Deprecated
-public class SkinResourceLoader
-    extends ResourceLoader
-{
-    public void init( ExtendedProperties configuration )
-    {
-    }
-
-    public synchronized InputStream getResourceStream( String name )
-        throws ResourceNotFoundException
-    {
-        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-
-        if ( name.startsWith( "/" ) )
-        {
-            name = name.substring( 1 );
-        }
-
-        return normalizeNewline( classLoader.getResourceAsStream( name ) );
-    }
-
-    InputStream normalizeNewline( InputStream in )
-        throws ResourceNotFoundException
-    {
-        if ( in == null )
-        {
-            return null;
-        }
-
-        try
-        {
-            byte[] content = IOUtil.toByteArray( in );
-
-            // following code based on org.apache.maven.doxia.sink.AbstractSink.unifyEOLs(String)
-
-            byte[] eol = System.getProperty( "line.separator" ).getBytes();
-
-            final int size = content.length;
-
-            ByteArrayOutputStream out = new ByteArrayOutputStream( size );
-
-            for ( int i = 0; i < size; i++ )
-            {
-                byte b = content[i];
-
-                if ( b == '\r' )
-                {
-                    if ( ( i + 1 ) < size && content[i + 1] == '\n' )
-                    {
-                        i++;
-                    }
-
-                    out.write( eol );
-                }
-                else if ( b == '\n' )
-                {
-                    out.write( eol );
-                }
-                else
-                {
-                    out.write( b );
-                }
-            }
-
-            return new ByteArrayInputStream( out.toByteArray() );
-        }
-        catch ( IOException ioe )
-        {
-            throw new ResourceNotFoundException( "cannot read resource", ioe );
-        }
-        finally
-        {
-            IOUtil.close( in );
-        }
-    }
-
-    public boolean isSourceModified( Resource resource )
-    {
-        return false;
-    }
-
-    public long getLastModified( Resource resource )
-    {
-        return 0;
-    }
-}
diff --git a/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/SkinResourceLoaderTest.java b/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/SkinResourceLoaderTest.java
deleted file mode 100644
index 6f7a5e9..0000000
--- a/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/SkinResourceLoaderTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.maven.doxia.siterenderer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.maven.doxia.sink.impl.AbstractSink;
-import org.codehaus.plexus.util.IOUtil;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-public class SkinResourceLoaderTest
-{
-    private SkinResourceLoader skinResourceLoader = new SkinResourceLoader();
-
-    @Test
-    public void testNormalizeNewline() throws Exception
-    {
-        String EOL = AbstractSink.EOL;
-        String EOL_MACOS9 = "\r";
-        String EOL_UNIX = "\n";
-        String EOL_WIN = "\r\n";
-        
-        assertEquals( "Hello " + EOL + " world", normalizeNewline( "Hello " + EOL_MACOS9 + " world" ) );
-        assertEquals( "Hello " + EOL + " world", normalizeNewline( "Hello " + EOL_UNIX + " world" ) );
-        assertEquals( "Hello " + EOL + " world", normalizeNewline( "Hello " + EOL_WIN + " world" ) );
-
-        assertEquals( "Hello world" + EOL, normalizeNewline( "Hello world" + EOL_MACOS9 ) );
-        assertEquals( "Hello world" + EOL, normalizeNewline( "Hello world" + EOL_UNIX ) );
-        assertEquals( "Hello world" + EOL, normalizeNewline( "Hello world" + EOL_WIN ) );
-
-        assertEquals( EOL + "Hello world", normalizeNewline( EOL_MACOS9 + "Hello world" ) );
-        assertEquals( EOL + "Hello world", normalizeNewline( EOL_UNIX + "Hello world" ) );
-        assertEquals( EOL + "Hello world", normalizeNewline( EOL_WIN + "Hello world" ) );
-    }
-    
-    private String normalizeNewline( String  text ) throws IOException
-    {
-        InputStream in = new ByteArrayInputStream( text.getBytes() ); 
-        InputStream out = skinResourceLoader.normalizeNewline( in );
-        return IOUtil.toString( out );
-    }
-}
diff --git a/doxia-site-renderer/src/test/resources/log4j.properties b/doxia-site-renderer/src/test/resources/log4j.properties
deleted file mode 100644
index 45cd5b3..0000000
--- a/doxia-site-renderer/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-log4j.rootCategory=INFO, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%5p [%c{1}:%L] %d{ISO8601} - %m%n
-
-log4j.logger.com.gargoylesoftware.htmlunit=ERROR
diff --git a/pom.xml b/pom.xml
index 3237687..b973a50 100644
--- a/pom.xml
+++ b/pom.xml
@@ -168,7 +168,13 @@ under the License.
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-velocity</artifactId>
-        <version>1.2</version>
+        <version>1.3-SNAPSHOT</version>
+        <exclusions>
+          <exclusion>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-container-default</artifactId>
+          </exclusion>
+        </exclusions>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
@@ -178,8 +184,13 @@ under the License.
       <!-- misc -->
       <dependency>
         <groupId>org.apache.velocity</groupId>
-        <artifactId>velocity</artifactId>
-        <version>1.7</version>
+        <artifactId>velocity-engine-core</artifactId>
+        <version>2.0</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.velocity.tools</groupId>
+        <artifactId>velocity-tools-generic</artifactId>
+        <version>3.0</version>
       </dependency>
       <!-- Test -->
       <dependency>
@@ -187,6 +198,11 @@ under the License.
         <artifactId>junit</artifactId>
         <version>4.13.2</version>
       </dependency>
+      <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-simple</artifactId>
+        <version>1.7.25</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
 
@@ -275,6 +291,8 @@ under the License.
             </goals>
             <configuration>
               <excludes>
+                <!-- DOXIASITETOOLS-166 Velocity Engine 2 -->
+                <exclude>org/apache/maven/doxia/siterenderer/SkinResourceLoader</exclude>
               </excludes>
             </configuration>
           </execution>