devacfr / reflow-maven-skin

Reflow is an Apache Maven site skin built on Bootstrap. It allows various structural and stylistic customizations to create a modern-looking Maven-generated website.
http://devacfr.github.io/reflow-maven-skin/
Apache License 2.0
8 stars 3 forks source link

replacing maven fluido skin in multi-module project fails building with velocity error while merging site template #90

Closed adrian-herscu closed 1 year ago

adrian-herscu commented 1 year ago

Replacing Maven Fluido Skin in my multi-module project fails building with:

Failed to execute goal org.apache.maven.plugins:maven-site-plugin:4.0.0-M8:site (default-site) on project qa-automation: Velocity error while merging site template.

Replaced only following sections:

  <skin>
    <groupId>io.github.devacfr.maven.skins</groupId>
    <artifactId>reflow-maven-skin</artifactId>
    <version>2.3.3</version>
<!--    <groupId>org.apache.maven.skins</groupId>-->
<!--    <artifactId>maven-fluido-skin</artifactId>-->
<!--    <version>2.0.0-M6</version>-->
  </skin>
  <custom>
    <reflowSkin>
      <absoluteResourceURL>https://qa-automation-starter.aherscu.dev</absoluteResourceURL>
      <theme>bootswatch-readable</theme>
    </reflowSkin>
<!--    <fluidoSkin>-->
<!--      &lt;!&ndash;profile>pre-release</profile&ndash;&gt;-->
<!--      <gitHub>-->
<!--        <projectId>QA-Automation-Starter/qa-automation</projectId>-->
<!--        <ribbonOrientation>right</ribbonOrientation>-->
<!--        <ribbonColor>black</ribbonColor>-->
<!--      </gitHub>-->
<!--      <googleSearch>-->
<!--        <sitesearch>qa-automation-starter.aherscu.dev</sitesearch>-->
<!--      </googleSearch>-->
<!--    </fluidoSkin>-->
  </custom>

and added:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>4.0.0-M8</version>
        <dependencies>
          <dependency>
            <groupId>io.github.devacfr.maven.skins</groupId>
            <artifactId>reflow-velocity-tools</artifactId>
            <version>2.3.3</version>
          </dependency>
        </dependencies>
      </plugin>

Perhaps I missing some more details about how to configure a multi-module project?

adrian-herscu commented 1 year ago

Tried with version 2.4.0-beta1 and getting:

[INFO] --- site:4.0.0-M8:site (default-site) @ qa-automation ---
[WARNING] Error initializing: org.codehaus.plexus.velocity.DefaultVelocityComponent@3b17bd6d
java.lang.NoSuchMethodError: org.apache.velocity.app.VelocityEngine.setProperties(Ljava/util/Properties;)V
    at org.codehaus.plexus.velocity.DefaultVelocityComponent.initialize (DefaultVelocityComponent.java:65)
    at org.eclipse.sisu.plexus.PlexusLifecycleManager.initialize (PlexusLifecycleManager.java:303)
    at org.eclipse.sisu.plexus.PlexusLifecycleManager.activate (PlexusLifecycleManager.java:207)
    at org.eclipse.sisu.bean.BeanScheduler.schedule (BeanScheduler.java:151)
    at org.eclipse.sisu.plexus.PlexusLifecycleManager.manage (PlexusLifecycleManager.java:147)
    at org.eclipse.sisu.plexus.PlexusBeanBinder.afterInjection (PlexusBeanBinder.java:72)
    at com.google.inject.internal.MembersInjectorImpl.notifyListeners (MembersInjectorImpl.java:130)
    at com.google.inject.internal.ConstructorInjector.provision (ConstructorInjector.java:125)
    at com.google.inject.internal.ConstructorInjector.access$000 (ConstructorInjector.java:33)
    at com.google.inject.internal.ConstructorInjector$1.call (ConstructorInjector.java:98)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:124)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ConstructorInjector.construct (ConstructorInjector.java:93)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get (ConstructorBindingImpl.java:300)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1101)
    at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1139)
    at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:86)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
    at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:67)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:124)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:62)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get (ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get (SingletonScope.java:169)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get (InternalFactoryToProviderAdapter.java:45)
    at com.google.inject.internal.SingleFieldInjector.inject (SingleFieldInjector.java:50)
    at com.google.inject.internal.MembersInjectorImpl.injectMembers (MembersInjectorImpl.java:146)
    at com.google.inject.internal.ConstructorInjector.provision (ConstructorInjector.java:124)
    at com.google.inject.internal.ConstructorInjector.access$000 (ConstructorInjector.java:33)
    at com.google.inject.internal.ConstructorInjector$1.call (ConstructorInjector.java:98)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
    at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision (BeanScheduler.java:230)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:117)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ConstructorInjector.construct (ConstructorInjector.java:93)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get (ConstructorBindingImpl.java:300)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get (ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get (SingletonScope.java:169)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get (InternalFactoryToProviderAdapter.java:45)
    at com.google.inject.internal.FactoryProxy.get (FactoryProxy.java:60)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1101)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
    at org.eclipse.sisu.plexus.PlexusRequirements$RequirementProvider.get (PlexusRequirements.java:250)
    at org.eclipse.sisu.plexus.ProvidedPropertyBinding.injectProperty (ProvidedPropertyBinding.java:48)
    at org.eclipse.sisu.bean.BeanInjector.injectMembers (BeanInjector.java:52)
    at com.google.inject.internal.MembersInjectorImpl.injectMembers (MembersInjectorImpl.java:159)
    at com.google.inject.internal.ConstructorInjector.provision (ConstructorInjector.java:124)
    at com.google.inject.internal.ConstructorInjector.access$000 (ConstructorInjector.java:33)
    at com.google.inject.internal.ConstructorInjector$1.call (ConstructorInjector.java:98)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:124)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ConstructorInjector.construct (ConstructorInjector.java:93)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get (ConstructorBindingImpl.java:300)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1101)
    at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1139)
    at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
    at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:86)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
    at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:67)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
    at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:124)
    at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
    at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:62)
    at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
    at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1101)
    at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
    at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
    at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
    at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo 
solomax commented 1 year ago

Hello @adrian-herscu

Can you try with org.apache.maven.plugins:maven-site-plugin:4.0.0-M9:site ?

adrian-herscu commented 1 year ago

Hi @solomax Upgraded maven-site-plugin per your instruction and now site:stage succeeds :) However, the index.html and all other pages are generated blank. Guess that it is some more complex to get it going. Can you please take a look into my site.xml (https://github.com/QA-Automation-Starter/qa-automation/blob/main/src/site/site.xml) and give me a direction? Thanks in advance!

solomax commented 1 year ago

@adrian-herscu https://github.com/QA-Automation-Starter/qa-automation/pull/175 :)

adrian-herscu commented 1 year ago

Ok... Tried to set this skin on a new project.

Started from here: https://maven.apache.org/guides/getting-started/index.html#how-do-i-make-my-first-maven-project

mvn -B archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4

Then:

  1. mvn site -- generated a standard Maven site
  2. added maven-site-plugin configuration to pom.xml
  3. added site.xml
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>4.0.0-M9</version>
        <dependencies>
          <dependency>
            <groupId>io.github.devacfr.maven.skins</groupId>
            <artifactId>reflow-velocity-tools</artifactId>
            <version>2.3.3</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>
<project>
  <skin>
    <groupId>io.github.devacfr.maven.skins</groupId>
    <artifactId>reflow-maven-skin</artifactId>
    <version>2.3.3</version>
  </skin>
</project>

Now I am running mvn site and getting:

[INFO] --- maven-site-plugin:4.0.0-M9:site (default-site) @ my-app ---
[INFO] Configuring report plugin maven-project-info-reports-plugin:3.0.0
[INFO] Detected 15 reports for maven-project-info-reports-plugin:3.0.0: ci-management, dependencies, dependency-info, dependency-management, distribution-management, index, issue-management, licenses, mailing-lists, modules, plugin-management, plugins, scm, summary, team
[INFO] Rendering site for default locale
[INFO] Relativizing site links with respect to localized project URL: http://www.example.com
[INFO] Rendering content with io.github.devacfr.maven.skins:reflow-maven-skin:jar:2.3.3 skin
[INFO] Rendering 7 report documents
[INFO] Generating "Dependencies" report  --- maven-project-info-reports-plugin:3.0.0:dependencies
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[INFO] Generating "Dependency Information" report --- maven-project-info-reports-plugin:3.0.0:dependency-info
[WARNING] An issue has occurred with maven-project-info-reports-plugin:3.0.0:dependency-info report, skipping LinkageError org.apache.maven.doxia.sink.Sink.verbatim(Z)V, please report an issue to Maven dev team.
java.lang.NoSuchMethodError: org.apache.maven.doxia.sink.Sink.verbatim(Z)V
    at org.apache.maven.reporting.AbstractMavenReportRenderer.verbatimText (AbstractMavenReportRenderer.java:448)
    at org.apache.maven.report.projectinfo.DependencyInformationReport$DependencyInformationRenderer.renderDependencyInfo (DependencyInformationReport.java:187)
    at org.apache.maven.report.projectinfo.DependencyInformationReport$DependencyInformationRenderer.renderBody (DependencyInformationReport.java:148)
    at org.apache.maven.reporting.AbstractMavenReportRenderer.render (AbstractMavenReportRenderer.java:80)
    at org.apache.maven.report.projectinfo.DependencyInformationReport.executeReport (DependencyInformationReport.java:93)
    at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:251)
    at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:198)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:298)
    at org.apache.maven.plugins.site.render.SiteMojo.renderNonDoxiaDocuments (SiteMojo.java:280)
    at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:162)
    at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:115)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] Generating "About" report         --- maven-project-info-reports-plugin:3.0.0:index
[INFO] Generating "Plugin Management" report --- maven-project-info-reports-plugin:3.0.0:plugin-management
[INFO] Generating "Plugins" report       --- maven-project-info-reports-plugin:3.0.0:plugins
[INFO] Generating "Summary" report       --- maven-project-info-reports-plugin:3.0.0:summary
[INFO] Generating "Project Information" report --- maven-site-plugin:4.0.0-M9:project-info
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

with empty pages: image

solomax commented 1 year ago

maven-site-plugin:4.0.0-M9 requires reflow-maven-skin:2.3.4-SNAPSHOT

please use maven-site-plugin:4.0.0-M5 with reflow-maven-skin:2.3.3

adrian-herscu commented 1 year ago

maven-site-plugin:4.0.0-M9 requires reflow-maven-skin:2.3.4-SNAPSHOT

please use maven-site-plugin:4.0.0-M5 with reflow-maven-skin:2.3.3

changed to maven-site-plugin:4.0.0-M5:

[INFO] --- maven-site-plugin:4.0.0-M5:site (default-site) @ my-app ---
[INFO] Configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:3.0.0
[INFO] 15 reports detected for maven-project-info-reports-plugin:3.0.0: ci-management, dependencies, dependency-info, dependency-management, distribution-management, index, issue-management, licenses, mailing-lists, modules, plugin-management, plugins, scm, summary, team
[INFO] Rendering site for default locale
[INFO] Relativizing decoration links with respect to localized project URL: http://www.example.com
[INFO] Rendering content with io.github.devacfr.maven.skins:reflow-maven-skin:jar:2.3.3 skin.
[INFO] Generating "Dependencies" report  --- maven-project-info-reports-plugin:3.0.0:dependencies
log4j:WARN No appenders could be found for logger (org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[INFO] Generating "Dependency Information" report --- maven-project-info-reports-plugin:3.0.0:dependency-info
[WARNING] An issue has occurred with maven-project-info-reports-plugin:3.0.0:dependency-info report, skipping LinkageError org.apache.maven.doxia.sink.Sink.verbatim(Z)V, please report an issue to Maven dev team.
java.lang.NoSuchMethodError: org.apache.maven.doxia.sink.Sink.verbatim(Z)V
    at org.apache.maven.reporting.AbstractMavenReportRenderer.verbatimText (AbstractMavenReportRenderer.java:448)
    at org.apache.maven.report.projectinfo.DependencyInformationReport$DependencyInformationRenderer.renderDependencyInfo (DependencyInformationReport.java:187)
    at org.apache.maven.report.projectinfo.DependencyInformationReport$DependencyInformationRenderer.renderBody (DependencyInformationRepor

BTW, https://devacfr.github.io/reflow-maven-skin/doc/reflow-documentation.html#doc-get-started_toc_configuration references M4; tried, got same result :(

solomax commented 1 year ago

Can you share the link to your project? I'll try to check :)

adrian-herscu commented 1 year ago

Can you share the link to your project? I'll try to check :)

It is nothing special. Just run the following:

mvn -B archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4
mvn site

Then add your site.xml and maven-site-plugin.

devacfr commented 1 year ago

Thanks @solomax for your help. Hello @adrian-herscu, following your remarks, I fixed the bootswatch cdn link. Other, the readable Bootswatch theme doesn't exist anymore.

I will test your project qa-automation with following changes:

pom.xml

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>4.0.0-M9</version>
        <dependencies>
          <dependency>
            <groupId>io.github.devacfr.maven.skins</groupId>
            <artifactId>reflow-velocity-tools</artifactId>
            <version>2.3.4</version>
          </dependency>
        </dependencies>
    </plugin>
  <skin>
    <groupId>io.github.devacfr.maven.skins</groupId>
    <artifactId>reflow-maven-skin</artifactId>
    <version>2.3.4</version>
  </skin>

  <custom>
    <reflowSkin>
      <absoluteResourceURL>https://qa-automation-starter.aherscu.dev</absoluteResourceURL>
      <theme>bootswatch-cerulean</theme>
      <highlightJs>true</highlightJs>
      <smoothScroll>true</smoothScroll>
      <highlightJsTheme>github</highlightJsTheme>
      <localResources>false</localResources>
      <bottomNav>
        <column>modules</column>
        <column>reports</column>
      </bottomNav>
    </reflowSkin>
  </custom>

after, I executed

$ mvn clean site site:stage

Here is the result

Capture d’écran 2023-08-20 à 10 20 45