Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package plexus-velocity for openSUSE:Factory
checked in at 2024-10-16 23:46:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/plexus-velocity (Old)
and /work/SRC/openSUSE:Factory/.plexus-velocity.new.19354 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "plexus-velocity"
Wed Oct 16 23:46:14 2024 rev:7 rq:1208205 version:2.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/plexus-velocity/plexus-velocity.changes
2024-05-27 12:03:59.955857453 +0200
+++
/work/SRC/openSUSE:Factory/.plexus-velocity.new.19354/plexus-velocity.changes
2024-10-16 23:47:03.537748529 +0200
@@ -1,0 +2,9 @@
+Thu Oct 3 13:56:35 UTC 2024 - Fridrich Strba <[email protected]>
+
+- Upgrade to version 2.1.0
+ * Changes:
+ + Upgrade to Velocity Engine 2.0
+ + Upgrade Velocity Engine from 2.0 to 2.3
+ + Move to JUnit5
+
+-------------------------------------------------------------------
Old:
----
plexus-velocity-1.2.tar.gz
New:
----
plexus-velocity-2.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ plexus-velocity.spec ++++++
--- /var/tmp/diff_new_pack.oZLAG7/_old 2024-10-16 23:47:05.065812257 +0200
+++ /var/tmp/diff_new_pack.oZLAG7/_new 2024-10-16 23:47:05.069812424 +0200
@@ -17,7 +17,7 @@
Name: plexus-velocity
-Version: 1.2
+Version: 2.1.0
Release: 0
Summary: Plexus Velocity Component
License: Apache-2.0
@@ -28,11 +28,12 @@
Source2: http://www.apache.org/licenses/LICENSE-2.0.txt
BuildRequires: ant
BuildRequires: apache-commons-collections
+BuildRequires: atinject
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local >= 6
-BuildRequires: sisu-plexus
-BuildRequires: velocity
+BuildRequires: sisu-inject
+BuildRequires: velocity-engine-core
BuildArch: noarch
%description
@@ -55,10 +56,8 @@
cp -p %{SOURCE1} build.xml
cp -p %{SOURCE2} LICENSE
-%pom_change_dep :plexus-container-default
org.eclipse.sisu:org.eclipse.sisu.plexus:0.9.0.M2
-
mkdir -p lib
-build-jar-repository -s lib commons-collections org.eclipse.sisu.plexus
velocity
+build-jar-repository -s lib atinject commons-collections
org.eclipse.sisu.inject velocity-engine/velocity-engine-core
%build
ant jar javadoc
++++++ plexus-velocity-1.2.tar.gz -> plexus-velocity-2.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/.github/dependabot.yml
new/plexus-velocity-plexus-velocity-2.1.0/.github/dependabot.yml
--- old/plexus-velocity-plexus-velocity-1.2/.github/dependabot.yml
1970-01-01 01:00:00.000000000 +0100
+++ new/plexus-velocity-plexus-velocity-2.1.0/.github/dependabot.yml
2023-12-23 23:25:38.000000000 +0100
@@ -0,0 +1,10 @@
+version: 2
+updates:
+ - package-ecosystem: "maven"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/.github/release-drafter.yml
new/plexus-velocity-plexus-velocity-2.1.0/.github/release-drafter.yml
--- old/plexus-velocity-plexus-velocity-1.2/.github/release-drafter.yml
1970-01-01 01:00:00.000000000 +0100
+++ new/plexus-velocity-plexus-velocity-2.1.0/.github/release-drafter.yml
2023-12-23 23:25:38.000000000 +0100
@@ -0,0 +1,2 @@
+_extends: .github
+tag-template: plexus-velocity-$NEXT_MINOR_VERSION
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/.github/workflows/maven.yml
new/plexus-velocity-plexus-velocity-2.1.0/.github/workflows/maven.yml
--- old/plexus-velocity-plexus-velocity-1.2/.github/workflows/maven.yml
1970-01-01 01:00:00.000000000 +0100
+++ new/plexus-velocity-plexus-velocity-2.1.0/.github/workflows/maven.yml
2023-12-23 23:25:38.000000000 +0100
@@ -0,0 +1,31 @@
+# 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.
+
+name: GitHub CI
+
+on: [push, pull_request]
+
+jobs:
+ build:
+ name: Build it
+ uses: codehaus-plexus/.github/.github/workflows/maven.yml@master
+
+ deploy:
+ name: Deploy
+ needs: build
+ uses: codehaus-plexus/.github/.github/workflows/maven-deploy.yml@master
+ secrets: inherit
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/.github/workflows/release-drafter.yml
new/plexus-velocity-plexus-velocity-2.1.0/.github/workflows/release-drafter.yml
---
old/plexus-velocity-plexus-velocity-1.2/.github/workflows/release-drafter.yml
1970-01-01 01:00:00.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/.github/workflows/release-drafter.yml
2023-12-23 23:25:38.000000000 +0100
@@ -0,0 +1,12 @@
+name: Release Drafter
+on:
+ push:
+ branches:
+ - master
+jobs:
+ update_release_draft:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: release-drafter/release-drafter@v5
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/plexus-velocity-plexus-velocity-1.2/README.md
new/plexus-velocity-plexus-velocity-2.1.0/README.md
--- old/plexus-velocity-plexus-velocity-1.2/README.md 1970-01-01
01:00:00.000000000 +0100
+++ new/plexus-velocity-plexus-velocity-2.1.0/README.md 2023-12-23
23:25:38.000000000 +0100
@@ -0,0 +1,8 @@
+Plexus-Velocity
+===============
+
+[](http://www.apache.org/licenses/)
+[](https://search.maven.org/artifact/org.codehaus.plexus/plexus-velocity)
+[](https://travis-ci.org/codehaus-plexus/plexus-velocity)
+
+The canonical git repository is located at
https://github.com/codehaus-plexus/plexus-velocity
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/plexus-velocity-plexus-velocity-1.2/pom.xml
new/plexus-velocity-plexus-velocity-2.1.0/pom.xml
--- old/plexus-velocity-plexus-velocity-1.2/pom.xml 2016-03-06
18:44:34.000000000 +0100
+++ new/plexus-velocity-plexus-velocity-2.1.0/pom.xml 2023-12-23
23:25:38.000000000 +0100
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2001-2006 Codehaus Foundation.
@@ -13,30 +14,30 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <artifactId>plexus-components</artifactId>
<groupId>org.codehaus.plexus</groupId>
- <version>4.0</version>
+ <artifactId>plexus</artifactId>
+ <version>16</version>
+ <relativePath />
</parent>
<artifactId>plexus-velocity</artifactId>
- <version>1.2</version>
+ <version>2.1.0</version>
<name>Plexus Velocity Component</name>
<scm>
-
<connection>scm:git:[email protected]:codehaus-plexus/plexus-velocity.git</connection>
-
<developerConnection>scm:git:[email protected]:codehaus-plexus/plexus-velocity.git</developerConnection>
- <url>http://github.com/codehaus-plexus/plexus-velocity</url>
- <tag>plexus-velocity-1.2</tag>
+
<connection>scm:git:https://github.com/codehaus-plexus/plexus-velocity.git</connection>
+ <developerConnection>${project.scm.connection}</developerConnection>
+ <tag>plexus-velocity-2.1.0</tag>
+ <url>https://github.com/codehaus-plexus/plexus-velocity</url>
</scm>
<issueManagement>
<system>github</system>
- <url>http://github.com/codehaus-plexus/plexus-velocity/issues</url>
+ <url>https://github.com/codehaus-plexus/plexus-velocity/issues</url>
</issueManagement>
<distributionManagement>
<site>
@@ -45,38 +46,80 @@
</site>
</distributionManagement>
+ <properties>
+ <slf4jVersion>1.7.36</slf4jVersion>
+
<project.build.outputTimestamp>2023-12-23T22:25:32Z</project.build.outputTimestamp>
+ </properties>
+
<dependencies>
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity-engine-core</artifactId>
+ <version>2.3</version>
</dependency>
+
+ <!-- Used by Velocity at runtime -->
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.1</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4jVersion}</version>
+ <scope>runtime</scope>
</dependency>
+
+ <!-- This is a Sisu Component, DI container should be provided by consumer
-->
<dependency>
- <groupId>org.apache.velocity</groupId>
- <artifactId>velocity</artifactId>
- <version>1.7</version>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>org.eclipse.sisu.inject</artifactId>
+ <version>0.9.0.M2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4jVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ <version>6.0.0</version>
+ <scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
+ <groupId>org.eclipse.sisu</groupId>
+ <artifactId>sisu-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<configuration>
- <content>${project.reporting.outputDirectory}</content><!--
mono-module doesn't require site:stage -->
+ <content>${project.reporting.outputDirectory}</content>
+ <!-- mono-module doesn't require site:stage -->
</configuration>
<executions>
<execution>
<id>scm-publish</id>
- <phase>site-deploy</phase><!-- deploy site with
maven-scm-publish-plugin -->
+ <!-- deploy site with maven-scm-publish-plugin -->
<goals>
<goal>publish-scm</goal>
</goals>
+ <phase>site-deploy</phase>
</execution>
</executions>
</plugin>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/ContextClassLoaderResourceLoader.java
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/ContextClassLoaderResourceLoader.java
---
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/ContextClassLoaderResourceLoader.java
2016-03-06 18:44:34.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/ContextClassLoaderResourceLoader.java
1970-01-01 01:00:00.000000000 +0100
@@ -1,80 +0,0 @@
-package org.codehaus.plexus.velocity;
-
-/*
- * Copyright 2001-2016 Codehaus Foundation.
- *
- * Licensed 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.InputStream;
-
-import org.apache.velocity.runtime.resource.Resource;
-import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
-import org.apache.velocity.runtime.resource.loader.ResourceLoader;
-import org.apache.velocity.exception.ResourceNotFoundException;
-
-import org.apache.commons.collections.ExtendedProperties;
-
-/**
- *
- * @deprecated use {@link ClasspathResourceLoader}
- *
- */
-@Deprecated
-public class ContextClassLoaderResourceLoader
- extends ResourceLoader
-{
- public void init( ExtendedProperties configuration)
- {
- }
-
- public synchronized InputStream getResourceStream( String name )
- throws ResourceNotFoundException
- {
- InputStream result = null;
-
- if (name == null || name.length() == 0)
- {
- throw new ResourceNotFoundException ("No template name provided");
- }
-
- try
- {
- ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
-
- if ( name.startsWith( "/" ) )
- {
- name = name.substring( 1 );
- }
-
- result = classLoader.getResourceAsStream( name );
- }
- catch( Exception fnfe )
- {
- throw new ResourceNotFoundException( fnfe.getMessage() );
- }
-
- return result;
- }
-
- public boolean isSourceModified(Resource resource)
- {
- return false;
- }
-
- public long getLastModified(Resource resource)
- {
- return 0;
- }
-}
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/DefaultVelocityComponent.java
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/DefaultVelocityComponent.java
---
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/DefaultVelocityComponent.java
2016-03-06 18:44:34.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/DefaultVelocityComponent.java
1970-01-01 01:00:00.000000000 +0100
@@ -1,177 +0,0 @@
-package org.codehaus.plexus.velocity;
-
-/*
- * Copyright 2001-2016 Codehaus Foundation.
- *
- * Licensed 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.util.Enumeration;
-import java.util.Properties;
-
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.runtime.RuntimeServices;
-import org.apache.velocity.runtime.RuntimeConstants;
-import org.apache.velocity.runtime.log.LogChute;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-
-/**
- * A simple velocity component implementation.
- * <p/>
- * A typical configuration will look like this:
- * <pre>
- * <configuration>
- * <properties>
- * <property>
- * <name>resource.loader</name>
- * <value>classpath</value>
- * </property>
- * <property>
- * <name>classpath.resource.loader.class</name>
- *
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
- * </property>
- * </properties>
- * </configuration>
- * </pre>
- */
-public class DefaultVelocityComponent
- extends AbstractLogEnabled
- implements VelocityComponent, Initializable, LogChute
-{
- private VelocityEngine engine;
-
- private Properties properties;
-
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- public void initialize()
- throws InitializationException
- {
- engine = new VelocityEngine();
-
- // avoid "unable to find resource 'VM_global_library.vm' in any
resource loader."
- engine.setProperty( RuntimeConstants.VM_LIBRARY, "" );
-
- engine.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, this );
-
- if ( properties != null )
- {
- for ( Enumeration<?> e = properties.propertyNames();
e.hasMoreElements(); )
- {
- String key = e.nextElement().toString();
-
- String value = properties.getProperty( key );
-
- engine.setProperty( key, value );
-
- getLogger().debug( "Setting property: " + key + " => '" +
value + "'." );
- }
- }
-
- try
- {
- engine.init();
- }
- catch ( Exception e )
- {
- throw new InitializationException( "Cannot start the Velocity
engine", e );
- }
- }
-
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- public VelocityEngine getEngine()
- {
- return engine;
- }
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- private RuntimeServices runtimeServices;
-
- public void init( RuntimeServices runtimeServices )
- {
- this.runtimeServices = runtimeServices;
- }
-
- public void log(int level, String message)
- {
- switch ( level )
- {
- case LogChute.WARN_ID:
- getLogger().warn( message );
- break;
- case LogChute.INFO_ID:
- getLogger().info( message );
- break;
- case LogChute.DEBUG_ID:
- case LogChute.TRACE_ID:
- getLogger().debug( message );
- break;
- case LogChute.ERROR_ID:
- getLogger().error( message );
- break;
- default:
- getLogger().debug( message );
- break;
- }
- }
-
- public void log(int level, String message, Throwable t)
- {
- switch ( level )
- {
- case LogChute.WARN_ID:
- getLogger().warn( message, t );
- break;
- case LogChute.INFO_ID:
- getLogger().info( message, t );
- break;
- case LogChute.DEBUG_ID:
- case LogChute.TRACE_ID:
- getLogger().debug( message, t );
- break;
- case LogChute.ERROR_ID:
- getLogger().error( message, t );
- break;
- default:
- getLogger().debug( message, t );
- break;
- }
- }
-
- public boolean isLevelEnabled( int level )
- {
- switch ( level )
- {
- case LogChute.WARN_ID:
- return getLogger().isWarnEnabled();
- case LogChute.INFO_ID:
- return getLogger().isInfoEnabled();
- case LogChute.DEBUG_ID:
- case LogChute.TRACE_ID:
- return getLogger().isDebugEnabled();
- case LogChute.ERROR_ID:
- return getLogger().isErrorEnabled();
- default:
- return getLogger().isDebugEnabled();
- }
- }
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/SiteResourceLoader.java
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/SiteResourceLoader.java
---
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/SiteResourceLoader.java
2016-03-06 18:44:34.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/SiteResourceLoader.java
1970-01-01 01:00:00.000000000 +0100
@@ -1,91 +0,0 @@
-package org.codehaus.plexus.velocity;
-
-/*
- * Copyright 2001-2016 Codehaus Foundation.
- *
- * Licensed 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.commons.collections.ExtendedProperties;
-import org.apache.velocity.runtime.resource.loader.FileResourceLoader;
-import org.apache.velocity.runtime.resource.loader.ResourceLoader;
-import org.apache.velocity.exception.ResourceNotFoundException;
-
-import java.io.InputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-/**
- * Allows you to dynamically add resources that you want to be processed by
Velocity. For
- * example if you want to generate a site and pull in some random files to be
interpolated
- * by Velocity you can use this resource loader.
- *
- * @author Jason van Zyl
- * @deprecated use {@link FileResourceLoader}
- */
-@Deprecated
-public class SiteResourceLoader
- extends ResourceLoader
-{
- private static String resource;
-
- private static File resourceDir;
-
- public static void setResource( String staticResource )
- {
- resource = staticResource;
- resourceDir = new File( resource ).getParentFile();
- }
-
- public void init( ExtendedProperties p )
- {
- }
-
- public InputStream getResourceStream( String name )
- throws ResourceNotFoundException
- {
- if ( resource != null )
- {
- try
- {
- File f = new File( resourceDir, name );
- if ( f.exists() )
- {
- return new FileInputStream( f );
- }
- else
- {
- return new FileInputStream( resource );
- }
- }
- catch ( FileNotFoundException e )
- {
- throw new ResourceNotFoundException( "Cannot find resource,
make sure you set the right resource." );
- }
- }
-
- return null;
- }
-
- public boolean isSourceModified(
org.apache.velocity.runtime.resource.Resource resource )
- {
- return false; //To change body of implemented methods use File |
Settings | File Templates.
- }
-
- public long getLastModified( org.apache.velocity.runtime.resource.Resource
resource )
- {
- return 0;
- }
-}
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/VelocityComponent.java
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/VelocityComponent.java
---
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/VelocityComponent.java
2016-03-06 18:44:34.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/VelocityComponent.java
2023-12-23 23:25:38.000000000 +0100
@@ -22,9 +22,9 @@
* The VelocityComponent API to access <a
href="http://velocity.apache.org/engine/">Apache Velocity Engine</a>
* configured through Plexus.
*/
-public interface VelocityComponent
-{
- public final static String ROLE = VelocityComponent.class.getName();
+public interface VelocityComponent {
+ @Deprecated
+ String ROLE = VelocityComponent.class.getName();
VelocityEngine getEngine();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/VelocityComponentConfigurator.java
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/VelocityComponentConfigurator.java
---
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/VelocityComponentConfigurator.java
1970-01-01 01:00:00.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/VelocityComponentConfigurator.java
2023-12-23 23:25:38.000000000 +0100
@@ -0,0 +1,29 @@
+package org.codehaus.plexus.velocity;
+
+/*
+ * Copyright 2001-2016 Codehaus Foundation.
+ *
+ * Licensed 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.util.Properties;
+
+/**
+ * The VelocityComponent configuration that may configure {@link
java.util.Properties} prior having them used to init
+ * Velocity Engine. This component is optional, is not needed if default are
sufficient.
+ *
+ * @since TBD
+ */
+public interface VelocityComponentConfigurator {
+ void configure(Properties properties);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/internal/DefaultVelocityComponent.java
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/internal/DefaultVelocityComponent.java
---
old/plexus-velocity-plexus-velocity-1.2/src/main/java/org/codehaus/plexus/velocity/internal/DefaultVelocityComponent.java
1970-01-01 01:00:00.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/main/java/org/codehaus/plexus/velocity/internal/DefaultVelocityComponent.java
2023-12-23 23:25:38.000000000 +0100
@@ -0,0 +1,73 @@
+package org.codehaus.plexus.velocity.internal;
+
+/*
+ * Copyright 2001-2016 Codehaus Foundation.
+ *
+ * Licensed 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 javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.util.Properties;
+
+import org.apache.velocity.app.VelocityEngine;
+import org.codehaus.plexus.velocity.VelocityComponent;
+import org.codehaus.plexus.velocity.VelocityComponentConfigurator;
+import org.eclipse.sisu.Nullable;
+
+/**
+ * Default component implementation. The presence of {@link
VelocityComponentConfigurator} is optional.
+ */
+@Singleton
+@Named
+public class DefaultVelocityComponent implements VelocityComponent {
+ private final VelocityEngine engine;
+
+ @Inject
+ public DefaultVelocityComponent(@Nullable VelocityComponentConfigurator
componentConfigurator) {
+ Properties properties = new Properties();
+
+ // fill in defaults
+ properties.setProperty("resource.loaders", "classpath,file");
+ properties.setProperty(
+ "resource.loader.classpath.class",
+
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+ properties.setProperty(
+ "resource.loader.file.class",
"org.apache.velocity.runtime.resource.loader.FileResourceLoader");
+ properties.setProperty("resource.loader.file.path", "");
+ properties.setProperty("runtime.log.log_invalid_references", "false");
+ properties.setProperty("resource.manager.log_when_found", "false");
+ properties.setProperty(
+ "event_handler.include.class",
"org.apache.velocity.app.event.implement.IncludeRelativePath");
+ properties.setProperty("velocimacro.inline.replace_global", "true");
+ properties.setProperty("parser.space_gobbling", "bc");
+
+ // customize if needed
+ if (componentConfigurator != null) {
+ componentConfigurator.configure(properties);
+ }
+
+ VelocityEngine engine = new VelocityEngine();
+ engine.setProperties(properties);
+ engine.init();
+
+ this.engine = engine;
+ }
+
+ @Override
+ public VelocityEngine getEngine() {
+ return engine;
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/main/resources/META-INF/plexus/components.xml
new/plexus-velocity-plexus-velocity-2.1.0/src/main/resources/META-INF/plexus/components.xml
---
old/plexus-velocity-plexus-velocity-1.2/src/main/resources/META-INF/plexus/components.xml
2016-03-06 18:44:34.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/main/resources/META-INF/plexus/components.xml
1970-01-01 01:00:00.000000000 +0100
@@ -1,52 +0,0 @@
-<component-set>
- <components>
- <component>
- <role>org.codehaus.plexus.velocity.VelocityComponent</role>
- <role-hint>default</role-hint>
-
<implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation>
- <configuration>
- <properties>
- <property>
- <name>resource.loader</name>
- <value>classpath,file</value>
- </property>
- <property>
- <name>classpath.resource.loader.class</name>
-
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
- </property>
- <property>
- <name>file.resource.loader.class</name>
-
<value>org.apache.velocity.runtime.resource.loader.FileResourceLoader</value>
- </property>
- <property>
- <name>file.resource.loader.path</name>
- <!-- This space intended! Actually Velocity expects an empty
string but
- Plexus/XStream choke on it and skip the remaining
configuration.
- Luckily, Plexus/XStream trim strings and we achieve the
desired effect. -->
- <value> </value>
- </property>
- <property>
- <name>runtime.log.invalid.references</name>
- <value>false</value>
- </property>
- <property>
- <name>velocimacro.messages.on</name>
- <value>false</value>
- </property>
- <property>
- <name>resource.manager.logwhenfound</name>
- <value>false</value>
- </property>
- <property>
- <name>eventhandler.include.class</name>
-
<value>org.apache.velocity.app.event.implement.IncludeRelativePath</value>
- </property>
- <property>
- <name>velocimacro.permissions.allow.inline.to.replace.global</name>
- <value>true</value>
- </property>
- </properties>
- </configuration>
- </component>
- </components>
-</component-set>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/site/site.xml
new/plexus-velocity-plexus-velocity-2.1.0/src/site/site.xml
--- old/plexus-velocity-plexus-velocity-1.2/src/site/site.xml 2016-03-06
18:44:34.000000000 +0100
+++ new/plexus-velocity-plexus-velocity-2.1.0/src/site/site.xml 2023-12-23
23:25:38.000000000 +0100
@@ -6,7 +6,7 @@
<body>
<menu name="Overview">
<item name="Introduction" href="index.html"/>
- <item name="JavaDocs" href="apidocs/index.html"/>
+ <item name="Javadoc" href="apidocs/index.html"/>
<item name="Source Xref" href="xref/index.html"/>
<!--item name="FAQ" href="faq.html"/-->
</menu>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/site/xdoc/index.xml
new/plexus-velocity-plexus-velocity-2.1.0/src/site/xdoc/index.xml
--- old/plexus-velocity-plexus-velocity-1.2/src/site/xdoc/index.xml
2016-03-06 18:44:34.000000000 +0100
+++ new/plexus-velocity-plexus-velocity-2.1.0/src/site/xdoc/index.xml
2023-12-23 23:25:38.000000000 +0100
@@ -16,7 +16,7 @@
<p>A typical use:
<source>
VelocityContext context = new VelocityContext();
-VelocityComponent velocityComponent = (DefaultVelocityComponent) lookup(
VelocityComponent.ROLE );
+VelocityComponent velocityComponent = lookup( VelocityComponent.class );
Template template = velocityComponent.getEngine().getTemplate( "path to your
template" );
StringWriter writer = new StringWriter();
template.merge( context, writer );</source>
@@ -24,28 +24,11 @@
</subsection>
<subsection name="Typical Configuration">
<p>Plexus Velocity Component comes with a default configuration: it is
- expected to be customized to match local specific need. This is done
by hand writing a
- <code>META-INF/plexus/components.xml</code> Plexus descriptor.</p>
- <p>A typical component configuration:
- <source>
-<![CDATA[ <component>
- <role>org.codehaus.plexus.velocity.VelocityComponent</role>
-
<implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation>
- <configuration>
- <properties>
- <property>
- <name>resource.loader</name>
- <value>classpath</value>
- </property>
- <property>
- <name>classpath.resource.loader.class</name>
-
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
- </property>
- </properties>
- </configuration>
- </component>]]></source>
+ expected to be customized to match local specific need. This is done
by creating
+ <code>VelocityComponentConfigurator</code> component
implementation. Presence of this component is
+ optional.
</p>
- <p>See <a
href="http://velocity.apache.org/engine/releases/velocity-1.7/developer-guide.html#Velocity_Configuration_Keys_and_Values">Velocity
Configuration Keys and Values</a>
+ <p>See <a
href="https://velocity.apache.org/engine/2.3/configuration.html">Velocity
Configuration</a>
reference documentation for details on available configurations.</p>
</subsection>
</section>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/test/java/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.java
new/plexus-velocity-plexus-velocity-2.1.0/src/test/java/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.java
---
old/plexus-velocity-plexus-velocity-1.2/src/test/java/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.java
2016-03-06 18:44:34.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/test/java/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.java
2023-12-23 23:25:38.000000000 +0100
@@ -20,40 +20,42 @@
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
-import org.codehaus.plexus.PlexusTestCase;
+import org.eclipse.sisu.launch.InjectedTest;
+import org.junit.jupiter.api.Test;
-public class DefaultVelocityComponentTest
- extends PlexusTestCase
-{
- public void testBasic()
- throws Exception
- {
- DefaultVelocityComponent velocity;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class DefaultVelocityComponentTest extends InjectedTest {
+ @Test
+ public void testBasic() {
+ VelocityComponent velocity;
VelocityContext context;
String value;
- velocity = (DefaultVelocityComponent) lookup( VelocityComponent.ROLE );
+ velocity = lookup(VelocityComponent.class);
// test the properties
- value = (String) velocity.getEngine().getProperty( "hello" );
+ value = (String) velocity.getEngine().getProperty("hello");
- assertNotNull( value );
+ assertNotNull(value);
- assertEquals( "world", value );
+ assertEquals("world", value);
// test the rendering
context = new VelocityContext();
- context.put( "variable", "Value from context" );
+ context.put("variable", "Value from context");
- Template template =
velocity.getEngine().getTemplate("org/codehaus/plexus/velocity/DefaultVelocityComponentTest.vm"
);
+ Template template =
+
velocity.getEngine().getTemplate("org/codehaus/plexus/velocity/DefaultVelocityComponentTest.vm");
StringWriter writer = new StringWriter();
- template.merge( context, writer );
+ template.merge(context, writer);
- assertEquals( "Static text -- Value from context -- More static text",
writer.toString() );
+ assertEquals("Static text -- Value from context -- More static text",
writer.toString());
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/test/java/org/codehaus/plexus/velocity/TestVelocityComponentConfigurator.java
new/plexus-velocity-plexus-velocity-2.1.0/src/test/java/org/codehaus/plexus/velocity/TestVelocityComponentConfigurator.java
---
old/plexus-velocity-plexus-velocity-1.2/src/test/java/org/codehaus/plexus/velocity/TestVelocityComponentConfigurator.java
1970-01-01 01:00:00.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/test/java/org/codehaus/plexus/velocity/TestVelocityComponentConfigurator.java
2023-12-23 23:25:38.000000000 +0100
@@ -0,0 +1,35 @@
+package org.codehaus.plexus.velocity;
+
+/*
+ * Copyright 2001-2016 Codehaus Foundation.
+ *
+ * Licensed 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 javax.inject.Named;
+import javax.inject.Singleton;
+
+import java.util.Properties;
+
+@Singleton
+@Named
+public class TestVelocityComponentConfigurator implements
VelocityComponentConfigurator {
+ @Override
+ public void configure(Properties properties) {
+ properties.setProperty("resource.loaders", "classpath");
+ properties.setProperty(
+ "resource.loader.classpath.class",
+
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+ properties.setProperty("hello", "world");
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/test/log4j.properties
new/plexus-velocity-plexus-velocity-2.1.0/src/test/log4j.properties
--- old/plexus-velocity-plexus-velocity-1.2/src/test/log4j.properties
2016-03-06 18:44:34.000000000 +0100
+++ new/plexus-velocity-plexus-velocity-2.1.0/src/test/log4j.properties
1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-log4j.rootCategory=DEBUG,testlog
-
-# testlog is set to be a File appender using a PatternLayout.
-log4j.appender.testlog = org.apache.log4j.FileAppender
-log4j.appender.testlog.File = test.log
-log4j.appender.testlog.Append = false
-log4j.appender.testlog.Threshold = DEBUG
-log4j.appender.testlog.layout = org.apache.log4j.PatternLayout
-log4j.appender.testlog.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/plexus-velocity-plexus-velocity-1.2/src/test/resources/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.xml
new/plexus-velocity-plexus-velocity-2.1.0/src/test/resources/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.xml
---
old/plexus-velocity-plexus-velocity-1.2/src/test/resources/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.xml
2016-03-06 18:44:34.000000000 +0100
+++
new/plexus-velocity-plexus-velocity-2.1.0/src/test/resources/org/codehaus/plexus/velocity/DefaultVelocityComponentTest.xml
1970-01-01 01:00:00.000000000 +0100
@@ -1,25 +0,0 @@
-<plexus>
- <components>
- <component>
- <role>org.codehaus.plexus.velocity.VelocityComponent</role>
- <role-hint>default</role-hint>
-
<implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation>
- <configuration>
- <properties>
- <property>
- <name>resource.loader</name>
- <value>classpath</value>
- </property>
- <property>
- <name>classpath.resource.loader.class</name>
-
<value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value>
- </property>
- <property>
- <name>hello</name>
- <value>world</value>
- </property>
- </properties>
- </configuration>
- </component>
- </components>
-</plexus>
++++++ plexus-velocity-build.xml ++++++
--- /var/tmp/diff_new_pack.oZLAG7/_old 2024-10-16 23:47:05.177816928 +0200
+++ /var/tmp/diff_new_pack.oZLAG7/_new 2024-10-16 23:47:05.181817095 +0200
@@ -10,9 +10,10 @@
<property name="project.groupId" value="org.codehaus.plexus"/>
<property name="project.artifactId" value="plexus-velocity"/>
- <property name="project.version" value="1.2"/>
+ <property name="project.version" value="2.1.0"/>
- <property name="compiler.source" value="1.8"/>
+ <property name="compiler.release" value="8"/>
+ <property name="compiler.source" value="1.${compiler.release}"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName"
value="${project.artifactId}-${project.version}"/>
@@ -29,18 +30,12 @@
<path id="build.classpath">
<fileset dir="lib">
- <!-- plexus-container-default-1.0-alpha-9-stable-1
- commons-collections-3.1 velocity-1.7 -->
<include name="**/*.jar">
</include>
</fileset>
</path>
<path id="build.test.classpath">
<fileset dir="lib">
- <!-- plexus-container-default-1.0-alpha-9-stable-1
- commons-collections-3.1 velocity-1.7
- plexus-utils-3.0.22 classworlds-1.1-alpha-2
- guava-20.0 xbean-reflect-4.5 commons-lang-2.4 -->
<include name="**/*.jar">
</include>
</fileset>
@@ -65,6 +60,7 @@
debug="true"
optimize="false"
deprecation="true"
+ release="${compiler.release}"
target="${compiler.target}"
verbose="false"
fork="false"
@@ -74,11 +70,34 @@
</src>
<classpath refid="build.classpath"/>
</javac>
- <copy todir="${build.outputDir}">
- <fileset dir="${build.resourceDir}"/>
- </copy>
</target>
+ <!-- ======================================================================
-->
+ <!-- Sisu javax.inject.Named generation target
-->
+ <!-- ======================================================================
-->
+
+ <target name="sisu"
+ depends="compile"
+ description="Generate javax.inject.Name index">
+ <sequential>
+ <java classname="org.eclipse.sisu.space.SisuIndex"
+ failonerror="true"
+ fork="true">
+ <classpath>
+ <path refid="build.classpath"/>
+ </classpath>
+ <arg value="${build.outputDir}"/>
+ </java>
+ <move todir="${build.outputDir}/META-INF">
+ <fileset dir="META-INF"/>
+ </move>
+ </sequential>
+ </target>
+
+ <!-- ======================================================================
-->
+ <!-- Javadoc target
-->
+ <!-- ======================================================================
-->
+
<target name="javadoc" description="Generates the Javadoc of the
application">
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
@@ -106,7 +125,7 @@
<!-- Package target
-->
<!-- ======================================================================
-->
- <target name="package" depends="compile" description="Package the
application">
+ <target name="package" depends="sisu" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"