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 2020/03/14 19:51:11 UTC

[maven-doxia-sitetools] 01/01: Upgrade to Velocity 2.2

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

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

commit a0d6256171f97b0edcdb7b7178bb80e85564d805
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat Mar 14 20:34:44 2020 +0100

    Upgrade to Velocity 2.2
---
 doxia-doc-renderer/pom.xml                         | 50 +++++-------
 .../docrenderer/AbstractDocumentRenderer.java      |  9 +--
 .../doxia/docrenderer/DocumentRendererContext.java |  4 +-
 .../velocity/DefaultVelocityComponent.java         | 87 +++++++++++++++++++++
 .../docrenderer/velocity/VelocityComponent.java    | 29 +++++++
 doxia-site-renderer/pom.xml                        | 46 +++--------
 .../doxia/siterenderer/DefaultSiteRenderer.java    |  7 +-
 .../doxia/siterenderer/SkinResourceLoader.java     | 13 +++-
 .../velocity/DefaultVelocityComponent.java         | 88 ++++++++++++++++++++++
 .../siterenderer/velocity/VelocityComponent.java   | 29 +++++++
 pom.xml                                            | 11 +--
 11 files changed, 285 insertions(+), 88 deletions(-)

diff --git a/doxia-doc-renderer/pom.xml b/doxia-doc-renderer/pom.xml
index ae55387..cecf16b 100644
--- a/doxia-doc-renderer/pom.xml
+++ b/doxia-doc-renderer/pom.xml
@@ -57,6 +57,16 @@ under the License.
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-module-fo</artifactId>
       <version>${doxiaVersion}</version>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.media</groupId>
+          <artifactId>jai-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>com.sun.media</groupId>
+          <artifactId>jai-codec</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <!-- The modules are not in doxia core anymore so you have to state a dependency so that
          the component descriptor gets picked up. -->
@@ -99,24 +109,19 @@ under the License.
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
-    <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>
+      <version>2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <version>1.7.30</version>
+      <scope>test</scope>
     </dependency>
-
     <!-- misc -->
     <dependency>
       <groupId>xalan</groupId>
@@ -145,25 +150,6 @@ under the License.
           </systemProperties>
         </configuration>
       </plugin>
-      <plugin><!-- TODO remove when minimum Java set to 7 -->
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>enforce-bytecode-version</id>
-            <configuration>
-              <rules>
-                <enforceBytecodeVersion>
-                  <excludes>
-                    <exclude>org.apache.maven.doxia:doxia-module-markdown</exclude>
-                    <exclude>org.nibor.autolink:autolink</exclude>
-                  </excludes>
-                </enforceBytecodeVersion>
-              </rules>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
   </build>
 </project>
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..9cb9f65 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
@@ -36,6 +36,7 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.apache.maven.doxia.Doxia;
+import org.apache.maven.doxia.docrenderer.velocity.VelocityComponent;
 import org.apache.maven.doxia.document.DocumentModel;
 import org.apache.maven.doxia.document.io.xpp3.DocumentXpp3Reader;
 import org.apache.maven.doxia.sink.Sink;
@@ -59,8 +60,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;
 
 /**
  * Abstract <code>document</code> renderer.
@@ -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 );
                     }
@@ -669,7 +668,7 @@ public abstract class AbstractDocumentRenderer
             getLogger().debug( "Velocity render for " + f.getAbsolutePath() );
         }
 
-        SiteResourceLoader.setResource( f.getAbsolutePath() );
+//        SiteResourceLoader.setResource( f.getAbsolutePath() );
 
         Context velocityContext = new VelocityContext();
 
@@ -677,7 +676,7 @@ public abstract class AbstractDocumentRenderer
         {
             for ( int i = 0; i < context.getKeys().length; i++ )
             {
-                String key = (String) context.getKeys()[i];
+                String key = context.getKeys()[i];
 
                 velocityContext.put( key, context.get( key ) );
             }
diff --git a/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java b/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java
index 4610637..b6a1610 100644
--- a/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java
+++ b/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java
@@ -117,9 +117,9 @@ public class DocumentRendererContext
      *
      *  @return Object[] of keys in the Context.
      */
-    public Object[] getKeys()
+    public String[] getKeys()
     {
-        return context.keySet().toArray();
+        return context.keySet().toArray( new String[0]);
     }
 
     /**
diff --git a/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/velocity/DefaultVelocityComponent.java b/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/velocity/DefaultVelocityComponent.java
new file mode 100644
index 0000000..54e18a3
--- /dev/null
+++ b/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/velocity/DefaultVelocityComponent.java
@@ -0,0 +1,87 @@
+package org.apache.maven.doxia.docrenderer.velocity;
+
+/*
+ * 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 org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.runtime.RuntimeConstants;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Properties;
+/**
+ * Velocity component XXX
+ */
+@Component( role = VelocityComponent.class )
+public class DefaultVelocityComponent implements VelocityComponent, Initializable
+{
+    private VelocityEngine engine;
+    private static final Logger LOGGER = LoggerFactory.getLogger( DefaultVelocityComponent.class );
+
+    @Override
+    public VelocityEngine getEngine()
+    {
+        if ( engine == null )
+        {
+            try
+            {
+                initialize();
+            }
+            catch ( InitializationException e )
+            {
+                LOGGER.error( "Initialize problem: " + e.getMessage() );
+            }
+        }
+        return engine;
+    }
+
+    @Override
+    public void initialize() throws InitializationException
+    {
+        engine = new VelocityEngine();
+        // avoid "unable to find resource 'VM_global_library.vm' in any resource loader."
+        Properties p = new Properties();
+        p.setProperty( "resource.loaders", "classpath,file" );
+        p.setProperty( "resource.loader.classpath.class",
+                "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader" );
+        p.setProperty( "resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader" );
+        p.setProperty( "resource.loader.file.path", "" );
+        p.setProperty( "runtime.log.log_invalid_references", "false" );
+        p.setProperty( "velocimacro.messages.on", "false" );
+        p.setProperty( "resource.manager.log_when_found", "false" );
+        p.setProperty( "event_handler.include.class", "org.apache.velocity.app.event.implement.IncludeRelativePath" );
+        p.setProperty( "velocimacro.inline.replace_global", "true" );
+
+        p.setProperty( RuntimeConstants.VM_LIBRARY, "" );
+
+        engine.setProperties( p );
+
+        try
+        {
+            engine.init();
+        }
+        catch ( Exception e )
+        {
+            throw new InitializationException( "Cannot start the Velocity engine", e );
+        }
+    }
+}
diff --git a/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/velocity/VelocityComponent.java b/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/velocity/VelocityComponent.java
new file mode 100644
index 0000000..cac3489
--- /dev/null
+++ b/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/velocity/VelocityComponent.java
@@ -0,0 +1,29 @@
+package org.apache.maven.doxia.docrenderer.velocity;
+
+/*
+ * 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 org.apache.velocity.app.VelocityEngine;
+/**
+ * Velocity component XXX
+ */
+public interface VelocityComponent
+{
+    VelocityEngine getEngine();
+}
diff --git a/doxia-site-renderer/pom.xml b/doxia-site-renderer/pom.xml
index ba4c0f6..d9677f2 100644
--- a/doxia-site-renderer/pom.xml
+++ b/doxia-site-renderer/pom.xml
@@ -114,49 +114,25 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-velocity</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
 
     <!-- misc -->
     <dependency>
       <groupId>org.apache.velocity</groupId>
-      <artifactId>velocity</artifactId>
+      <artifactId>velocity-engine-core</artifactId>
+      <version>2.2</version>
     </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>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <version>1.7.30</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.velocity.tools</groupId>
+      <artifactId>velocity-tools-generic</artifactId>
+      <version>3.0</version>
     </dependency>
     <dependency>
       <groupId>commons-collections</groupId>
diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
index 13eea52..d824481 100644
--- a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
+++ b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
@@ -54,7 +54,6 @@ import java.util.zip.ZipException;
 import java.util.zip.ZipFile;
 
 import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.SystemUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
@@ -74,6 +73,7 @@ import org.apache.maven.doxia.parser.module.ParserModule;
 import org.apache.maven.doxia.parser.module.ParserModuleManager;
 import org.apache.maven.doxia.parser.module.ParserModuleNotFoundException;
 import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
+import org.apache.maven.doxia.siterenderer.velocity.VelocityComponent;
 import org.apache.maven.doxia.util.XmlValidator;
 import org.apache.velocity.Template;
 import org.apache.velocity.context.Context;
@@ -116,7 +116,6 @@ import org.codehaus.plexus.util.ReaderFactory;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.WriterFactory;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import org.codehaus.plexus.velocity.VelocityComponent;
 
 /**
  * <p>DefaultSiteRenderer class.</p>
@@ -530,7 +529,7 @@ public class DefaultSiteRenderer
     /**
      * Create a Velocity Context for a Doxia document, containing every information about rendered document.
      *
-     * @param sink the site renderer sink for the document
+     * @param renderingContext the site renderer sink for the document
      * @param siteRenderingContext the site rendering context
      * @return
      */
@@ -749,7 +748,7 @@ public class DefaultSiteRenderer
             {
                 StringWriter sw = new StringWriter();
                 template.merge( context, sw );
-                writer.write( sw.toString().replaceAll( "\r?\n", SystemUtils.LINE_SEPARATOR ) );
+                writer.write( sw.toString().replaceAll( "\r?\n", System.lineSeparator() ) );
             }
             catch ( VelocityException ve )
             {
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
index e8870de..ca68857 100644
--- 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
@@ -23,11 +23,12 @@ import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.Reader;
 
 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.apache.velocity.util.ExtProperties;
 import org.codehaus.plexus.util.IOUtil;
 
 /**
@@ -41,8 +42,16 @@ import org.codehaus.plexus.util.IOUtil;
 public class SkinResourceLoader
     extends ResourceLoader
 {
-    public void init( ExtendedProperties configuration )
+    @Override
+    public void init( ExtProperties extProperties )
     {
+
+    }
+
+    @Override
+    public Reader getResourceReader( String s, String s1 ) throws ResourceNotFoundException
+    {
+        return null;
     }
 
     public synchronized InputStream getResourceStream( String name )
diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/velocity/DefaultVelocityComponent.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/velocity/DefaultVelocityComponent.java
new file mode 100644
index 0000000..1910156
--- /dev/null
+++ b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/velocity/DefaultVelocityComponent.java
@@ -0,0 +1,88 @@
+package org.apache.maven.doxia.siterenderer.velocity;
+
+/*
+ * 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 org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.runtime.RuntimeConstants;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Properties;
+
+/**
+ * Velocity component XXX
+ */
+@Component( role = VelocityComponent.class )
+public class DefaultVelocityComponent implements VelocityComponent, Initializable
+{
+    private VelocityEngine engine;
+    private static final Logger LOGGER = LoggerFactory.getLogger( DefaultVelocityComponent.class );
+
+    @Override
+    public VelocityEngine getEngine()
+    {
+        if ( engine == null )
+        {
+            try
+            {
+                initialize();
+            }
+            catch ( InitializationException e )
+            {
+                LOGGER.error( "Initialize problem: " + e.getMessage() );
+            }
+        }
+        return engine;
+    }
+
+    @Override
+    public void initialize() throws InitializationException
+    {
+        engine = new VelocityEngine();
+        // avoid "unable to find resource 'VM_global_library.vm' in any resource loader."
+        Properties p = new Properties();
+        p.setProperty( "resource.loaders", "classpath,file" );
+        p.setProperty( "resource.loader.classpath.class",
+                "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader" );
+        p.setProperty( "resource.loader.file.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader" );
+        p.setProperty( "resource.loader.file.path", "" );
+        p.setProperty( "runtime.log.log_invalid_references", "false" );
+        p.setProperty( "velocimacro.messages.on", "false" );
+        p.setProperty( "resource.manager.log_when_found", "false" );
+        p.setProperty( "event_handler.include.class", "org.apache.velocity.app.event.implement.IncludeRelativePath" );
+        p.setProperty( "velocimacro.inline.replace_global", "true" );
+
+        p.setProperty( RuntimeConstants.VM_LIBRARY, "" );
+
+        engine.setProperties( p );
+
+        try
+        {
+            engine.init();
+        }
+        catch ( Exception e )
+        {
+            throw new InitializationException( "Cannot start the Velocity engine", e );
+        }
+    }
+}
diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/velocity/VelocityComponent.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/velocity/VelocityComponent.java
new file mode 100644
index 0000000..f8c3e34
--- /dev/null
+++ b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/velocity/VelocityComponent.java
@@ -0,0 +1,29 @@
+package org.apache.maven.doxia.siterenderer.velocity;
+
+/*
+ * 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 org.apache.velocity.app.VelocityEngine;
+/**
+ * Velocity component XXX
+ */
+public interface VelocityComponent
+{
+    VelocityEngine getEngine();
+}
diff --git a/pom.xml b/pom.xml
index f1cf8c0..048285d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,7 +69,7 @@ under the License.
   </distributionManagement>
 
   <properties>
-    <javaVersion>7</javaVersion>
+    <javaVersion>8</javaVersion>
     <doxiaVersion>1.9.1</doxiaVersion>
     <maven.site.path>doxia-sitetools-archives/doxia-sitetools-LATEST</maven.site.path>
     <project.build.outputTimestamp>2020-02-19T07:03:09Z</project.build.outputTimestamp>
@@ -168,19 +168,14 @@ under the License.
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-velocity</artifactId>
-        <version>1.2</version>
-      </dependency>
-      <dependency>
-        <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-utils</artifactId>
         <version>3.0.22</version>
       </dependency>
       <!-- misc -->
       <dependency>
         <groupId>org.apache.velocity</groupId>
-        <artifactId>velocity</artifactId>
-        <version>1.7</version>
+        <artifactId>velocity-engine-core</artifactId>
+        <version>2.2</version>
       </dependency>
       <!-- Test -->
       <dependency>