From 8b4b9cda9862873915cacc8fd961b5d8a72b9f09395d1cf40905d77a6b10d5ad Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 1 Oct 2024 22:37:58 +0000 Subject: [PATCH] move out of test OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-doxia-sitetools?expand=0&rev=32 --- ...-Remove-dependency-on-velocity-tools.patch | 171 +++++++++--------- _service | 16 ++ doxia-sitetools-1.11.1-source-release.zip | 3 - maven-doxia-sitetools-2.0.0~M19.tar.xz | 3 + maven-doxia-sitetools-build.tar.xz | 4 +- maven-doxia-sitetools.spec | 111 ++++-------- 6 files changed, 150 insertions(+), 158 deletions(-) rename 0002-Remove-dependency-on-velocity-tools.patch => 0001-Remove-dependency-on-velocity-tools.patch (51%) create mode 100644 _service delete mode 100644 doxia-sitetools-1.11.1-source-release.zip create mode 100644 maven-doxia-sitetools-2.0.0~M19.tar.xz diff --git a/0002-Remove-dependency-on-velocity-tools.patch b/0001-Remove-dependency-on-velocity-tools.patch similarity index 51% rename from 0002-Remove-dependency-on-velocity-tools.patch rename to 0001-Remove-dependency-on-velocity-tools.patch index 356a4e9..a03ec99 100644 --- a/0002-Remove-dependency-on-velocity-tools.patch +++ b/0001-Remove-dependency-on-velocity-tools.patch @@ -1,92 +1,99 @@ -From da397953bd73068c4ab8d219ec91e312fd3d5d55 Mon Sep 17 00:00:00 2001 +From 7b2073aa38961c5069508c40274b1b644ccb195d Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Mon, 6 Feb 2017 14:27:53 +0100 -Subject: [PATCH 2/2] Remove dependency on velocity-tools +Subject: [PATCH] Remove dependency on velocity-tools --- - .../doxia/siterenderer/DefaultSiteRenderer.java | 58 +--------------------- - 1 file changed, 2 insertions(+), 56 deletions(-) + .../siterenderer/DefaultSiteRenderer.java | 65 +------------------ + 2 files changed, 2 insertions(+), 68 deletions(-) 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 c31688d..58058b3 100644 +index 7e41c4a..6efdcaf 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 -@@ -76,31 +76,11 @@ import org.apache.maven.doxia.parser.mod - import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; - import org.apache.maven.doxia.util.XmlValidator; - import org.apache.velocity.Template; -+import org.apache.velocity.VelocityContext; - import org.apache.velocity.context.Context; - import org.apache.velocity.exception.ParseErrorException; - import org.apache.velocity.exception.ResourceNotFoundException; - import org.apache.velocity.exception.VelocityException; --import org.apache.velocity.tools.Scope; --import org.apache.velocity.tools.ToolManager; --import org.apache.velocity.tools.config.ConfigurationUtils; --import org.apache.velocity.tools.config.EasyFactoryConfiguration; --import org.apache.velocity.tools.config.FactoryConfiguration; --import org.apache.velocity.tools.generic.AlternatorTool; --import org.apache.velocity.tools.generic.ClassTool; --import org.apache.velocity.tools.generic.ComparisonDateTool; --import org.apache.velocity.tools.generic.ContextTool; --import org.apache.velocity.tools.generic.ConversionTool; --import org.apache.velocity.tools.generic.DisplayTool; --import org.apache.velocity.tools.generic.EscapeTool; --import org.apache.velocity.tools.generic.FieldTool; --import org.apache.velocity.tools.generic.LinkTool; --import org.apache.velocity.tools.generic.LoopTool; --import org.apache.velocity.tools.generic.MathTool; --import org.apache.velocity.tools.generic.NumberTool; --import org.apache.velocity.tools.generic.RenderTool; --import org.apache.velocity.tools.generic.ResourceTool; --import org.apache.velocity.tools.generic.SortTool; --import org.apache.velocity.tools.generic.XmlTool; - import org.codehaus.plexus.PlexusContainer; - import org.codehaus.plexus.component.annotations.Component; - import org.codehaus.plexus.component.annotations.Requirement; -@@ -495,41 +475,7 @@ public class DefaultSiteRenderer - */ - protected Context createToolManagedVelocityContext( SiteRenderingContext siteRenderingContext ) - { -- Locale locale = siteRenderingContext.getLocale(); -- String dateFormat = siteRenderingContext.getDecoration().getPublishDate().getFormat(); -- -- EasyFactoryConfiguration config = new EasyFactoryConfiguration( false ); -- config.property( "safeMode", Boolean.FALSE ); -- config.toolbox( Scope.REQUEST ) -- .tool( ContextTool.class ) -- .tool( LinkTool.class ) -- .tool( LoopTool.class ) -- .tool( RenderTool.class ); -- config.toolbox( Scope.APPLICATION ).property( "locale", locale ) -- .tool( AlternatorTool.class ) -- .tool( ClassTool.class ) -- .tool( ComparisonDateTool.class ).property( "format", dateFormat ) -- .tool( ConversionTool.class ).property( "dateFormat", dateFormat ) -- .tool( DisplayTool.class ) -- .tool( EscapeTool.class ) -- .tool( FieldTool.class ) -- .tool( MathTool.class ) -- .tool( NumberTool.class ) -- .tool( ResourceTool.class ).property( "bundles", new String[] { "site-renderer" } ) -- .tool( SortTool.class ) -- .tool( XmlTool.class ); -- -- FactoryConfiguration customConfig = ConfigurationUtils.findInClasspath( TOOLS_LOCATION ); -- -- if ( customConfig != null ) -- { -- config.addConfiguration( customConfig ); -- } -- -- ToolManager manager = new ToolManager( false, false ); -- manager.configure( config ); -- -- return manager.createContext(); -+ return new VelocityContext(); - } - - /** +@@ -70,31 +70,11 @@ import org.apache.maven.doxia.siterenderer.SiteRenderingContext.SiteDirectory; + import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink; + import org.apache.maven.doxia.util.XmlValidator; + import org.apache.velocity.Template; ++import org.apache.velocity.VelocityContext; + import org.apache.velocity.context.Context; + import org.apache.velocity.exception.ParseErrorException; + import org.apache.velocity.exception.ResourceNotFoundException; + import org.apache.velocity.exception.VelocityException; +-import org.apache.velocity.tools.Scope; +-import org.apache.velocity.tools.ToolManager; +-import org.apache.velocity.tools.config.ConfigurationUtils; +-import org.apache.velocity.tools.config.EasyFactoryConfiguration; +-import org.apache.velocity.tools.config.FactoryConfiguration; +-import org.apache.velocity.tools.generic.AlternatorTool; +-import org.apache.velocity.tools.generic.ClassTool; +-import org.apache.velocity.tools.generic.ComparisonDateTool; +-import org.apache.velocity.tools.generic.ContextTool; +-import org.apache.velocity.tools.generic.ConversionTool; +-import org.apache.velocity.tools.generic.DisplayTool; +-import org.apache.velocity.tools.generic.EscapeTool; +-import org.apache.velocity.tools.generic.FieldTool; +-import org.apache.velocity.tools.generic.LinkTool; +-import org.apache.velocity.tools.generic.LoopTool; +-import org.apache.velocity.tools.generic.MathTool; +-import org.apache.velocity.tools.generic.NumberTool; +-import org.apache.velocity.tools.generic.RenderTool; +-import org.apache.velocity.tools.generic.ResourceTool; +-import org.apache.velocity.tools.generic.SortTool; +-import org.apache.velocity.tools.generic.XmlTool; + import org.codehaus.plexus.PlexusContainer; + import org.codehaus.plexus.util.DirectoryScanner; + import org.codehaus.plexus.util.FileUtils; +@@ -425,48 +405,7 @@ public class DefaultSiteRenderer implements Renderer { + * @return a Velocity tools managed context + */ + protected Context createToolManagedVelocityContext(SiteRenderingContext siteRenderingContext) { +- Locale locale = siteRenderingContext.getLocale(); +- String dateFormat = siteRenderingContext.getSiteModel().getPublishDate().getFormat(); +- String timeZoneId = siteRenderingContext.getSiteModel().getPublishDate().getTimezone(); +- TimeZone timeZone = +- "system".equalsIgnoreCase(timeZoneId) ? TimeZone.getDefault() : TimeZone.getTimeZone(timeZoneId); +- +- EasyFactoryConfiguration config = new EasyFactoryConfiguration(false); +- config.property("safeMode", Boolean.FALSE); +- config.toolbox(Scope.REQUEST) +- .tool(ContextTool.class) +- .tool(LinkTool.class) +- .tool(LoopTool.class) +- .tool(RenderTool.class); +- config.toolbox(Scope.APPLICATION) +- .property("locale", locale) +- .tool(AlternatorTool.class) +- .tool(ClassTool.class) +- .tool(ComparisonDateTool.class) +- .property("format", dateFormat) +- .property("timezone", timeZone) +- .tool(ConversionTool.class) +- .property("dateFormat", dateFormat) +- .tool(DisplayTool.class) +- .tool(EscapeTool.class) +- .tool(FieldTool.class) +- .tool(MathTool.class) +- .tool(NumberTool.class) +- .tool(ResourceTool.class) +- .property("bundles", new String[] {"site-renderer"}) +- .tool(SortTool.class) +- .tool(XmlTool.class); +- +- FactoryConfiguration customConfig = ConfigurationUtils.findInClasspath(TOOLS_LOCATION); +- +- if (customConfig != null) { +- config.addConfiguration(customConfig); +- } +- +- ToolManager manager = new ToolManager(false, false); +- manager.configure(config); +- +- return manager.createContext(); ++ return new VelocityContext(); + } + + /** -- -2.9.3 +2.46.1 diff --git a/_service b/_service new file mode 100644 index 0000000..e32c728 --- /dev/null +++ b/_service @@ -0,0 +1,16 @@ + + + git + https://github.com/apache/maven-doxia-sitetools.git + doxia-sitetools-2.0.0-M19 + doxia-* + @PARENT_TAG@ + doxia-sitetools-(\d+).(\d+).(\d+)-(.*) + \1.\2.\3~\4 + + + *.tar + xz + + + diff --git a/doxia-sitetools-1.11.1-source-release.zip b/doxia-sitetools-1.11.1-source-release.zip deleted file mode 100644 index 5ac8327..0000000 --- a/doxia-sitetools-1.11.1-source-release.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b5d1e30d32129af3d026a1347efb2005824c44cf1674716a21692f4a7698057a -size 555803 diff --git a/maven-doxia-sitetools-2.0.0~M19.tar.xz b/maven-doxia-sitetools-2.0.0~M19.tar.xz new file mode 100644 index 0000000..44be8f0 --- /dev/null +++ b/maven-doxia-sitetools-2.0.0~M19.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8bc9dc23d8b8a0f73746fe211161d44309003facb8c6d584a1e7ef6f8aacb64 +size 169452 diff --git a/maven-doxia-sitetools-build.tar.xz b/maven-doxia-sitetools-build.tar.xz index dd88ea1..dc18674 100644 --- a/maven-doxia-sitetools-build.tar.xz +++ b/maven-doxia-sitetools-build.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fb752bf9f951b9e2a3f065a85fcbdc84c1503fbcb3d1e9c32d1df46b34e2689f -size 3472 +oid sha256:e96c4fe83c8bdb13590022898b649463806b691a4d9a5a4e05e4891bc22a0b67 +size 2588 diff --git a/maven-doxia-sitetools.spec b/maven-doxia-sitetools.spec index 85dd471..3fa1e8c 100644 --- a/maven-doxia-sitetools.spec +++ b/maven-doxia-sitetools.spec @@ -16,51 +16,41 @@ # -%global parent maven-doxia -%global subproj sitetools -Name: %{parent}-%{subproj} -Version: 1.11.1 +%global pom_version 2.0.0-M19 +Name: maven-doxia-sitetools +Version: 2.0.0~M19 Release: 0 Summary: Doxia content generation framework License: Apache-2.0 Group: Development/Libraries/Java URL: https://maven.apache.org/doxia/ -Source0: https://repo1.maven.org/maven2/org/apache/maven/doxia/doxia-sitetools/%{version}/doxia-%{subproj}-%{version}-source-release.zip +Source0: %{name}-%{version}.tar.xz Source1: %{name}-build.tar.xz -Patch1: 0002-Remove-dependency-on-velocity-tools.patch +Patch1: 0001-Remove-dependency-on-velocity-tools.patch BuildRequires: ant -BuildRequires: apache-commons-collections BuildRequires: apache-commons-io BuildRequires: apache-commons-lang3 +BuildRequires: atinject BuildRequires: fdupes BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local >= 6 BuildRequires: maven-doxia-core -BuildRequires: maven-doxia-logging-api -BuildRequires: maven-doxia-module-fo -BuildRequires: maven-doxia-module-xhtml +BuildRequires: maven-doxia-module-xhtml5 BuildRequires: maven-doxia-sink-api BuildRequires: maven-lib BuildRequires: maven-reporting-api -BuildRequires: modello >= 2.0.0 -BuildRequires: plexus-containers-component-annotations +BuildRequires: maven-resolver-api +BuildRequires: modello BuildRequires: plexus-i18n BuildRequires: plexus-interpolation BuildRequires: plexus-metadata-generator BuildRequires: plexus-utils BuildRequires: plexus-velocity BuildRequires: plexus-xml +BuildRequires: sisu-inject BuildRequires: sisu-plexus -BuildRequires: unzip -BuildRequires: velocity -BuildRequires: xmvn-install -BuildRequires: xmvn-resolve -BuildRequires: xz -BuildRequires: mvn(org.apache.maven.doxia:doxia-module-apt) -BuildRequires: mvn(org.apache.maven.doxia:doxia-module-fml) -BuildRequires: mvn(org.apache.maven.doxia:doxia-module-xdoc) -BuildRequires: mvn(org.apache.maven.doxia:doxia-module-xhtml5) -BuildRequires: mvn(org.apache.maven:maven-parent:pom:) +BuildRequires: slf4j +BuildRequires: velocity-engine-core BuildArch: noarch %description @@ -78,79 +68,58 @@ Group: Development/Libraries/Java API documentation for %{name}. %prep -%setup -q -n doxia-%{subproj}-%{version} -a1 +%setup -q -a1 %patch -P 1 -p1 -# migrate to maven 3 -%pom_xpath_set //pom:mavenVersion 3.8.6 doxia-integration-tools -%pom_change_dep :maven-artifact-manager :maven-core doxia-integration-tools -%pom_change_dep :maven-project :maven-compat doxia-integration-tools - -# complains -%pom_remove_plugin :apache-rat-plugin - -%pom_remove_plugin org.codehaus.mojo:clirr-maven-plugin -%pom_remove_dep net.sourceforge.htmlunit:htmlunit doxia-site-renderer/pom.xml -%pom_remove_dep -r :velocity-tools - -rm -rf $(find -type d -name itext) -%pom_remove_dep -r :doxia-module-itext - -%pom_remove_dep -r :doxia-module-markdown - -for i in doxia-decoration-model doxia-doc-renderer doxia-integration-tools doxia-site-renderer; do - %pom_add_dep org.codehaus.plexus:plexus-xml:3.0.0 ${i} -done - -%{mvn_alias} :doxia-integration-tools org.apache.maven.shared:maven-doxia-tools +%pom_remove_dep -r :velocity-tools-generic %build mkdir -p lib build-jar-repository -s lib \ - apache-commons-collections \ apache-commons-lang3 \ + atinject \ commons-io \ maven-doxia/doxia-core \ - maven-doxia/doxia-logging-api \ - maven-doxia/doxia-module-fo \ - maven-doxia/doxia-module-xhtml \ maven-doxia/doxia-module-xhtml5 \ maven-doxia/doxia-sink-api \ maven/maven-artifact \ maven/maven-core \ - maven/maven-plugin-api \ - maven/maven-project \ + maven/maven-model \ maven-reporting-api/maven-reporting-api \ + maven-resolver/maven-resolver-api \ + org.eclipse.sisu.inject \ org.eclipse.sisu.plexus \ - plexus-containers/plexus-component-annotations \ plexus-i18n/plexus-i18n \ plexus/interpolation \ plexus/utils \ - plexus/xml \ plexus-velocity/plexus-velocity \ - velocity -# tests can't run because of missing deps -%{ant} -Dtest.skip=true package javadoc + plexus/xml \ + slf4j/api \ + velocity-engine/velocity-engine-core -mkdir -p target/site/apidocs -for i in \ - doxia-decoration-model \ - doxia-skin-model \ - doxia-integration-tools \ - doxia-site-renderer; do - %{mvn_artifact} ${i}/pom.xml ${i}/target/${i}-%{version}.jar - if [ -d ${i}/target/site/apidocs ]; then - cp -r ${i}/target/site/apidocs target/site/apidocs/${i} - fi -done +ant package javadoc %install -%mvn_install +install -dm 0755 %{buildroot}%{_javadir}/%{name} +install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} +install -dm 0755 %{buildroot}%{_javadocdir}/%{name} +for i in \ + doxia-site-model \ + doxia-skin-model \ + doxia-site-renderer \ + doxia-integration-tools; do + install -pm 0644 ${i}/target/${i}-%pom_version.jar %{buildroot}%{_javadir}/%{name}/${i}.jar + %{mvn_install_pom} ${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/${i}.pom + %add_maven_depmap %{name}/${i}.pom %{name}/${i}.jar -f ${i} + if [ -d ${i}/target/site/apidocs ]; then + cp -r ${i}/target/site/apidocs %{buildroot}%{_javadocdir}/%{name}/${i} + fi +done %fdupes -s %{buildroot}%{_javadocdir} -%files -f .mfiles -%dir %{_javadir}/%{name} +%files -f .mfiles-doxia-integration-tools -f .mfiles-doxia-site-model -f .mfiles-doxia-site-renderer -f .mfiles-doxia-skin-model -%files javadoc -f .mfiles-javadoc +%files javadoc +%{_javadocdir}/%{name} %changelog