maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abel Salgado Romero (JIRA)" <>
Subject [jira] [Created] (MSITE-849) Unable to inject MavenProject when using `mvn site:run`
Date Thu, 15 Aug 2019 17:14:00 GMT
Abel Salgado Romero created MSITE-849:

             Summary: Unable to inject MavenProject when using `mvn site:run`
                 Key: MSITE-849
             Project: Maven Site Plugin
          Issue Type: New Feature
    Affects Versions: 3.8.2, 3.7.1
            Reporter: Abel Salgado Romero

In we inject a MavenProject to obtain
addition configurations from the pom.xml (
This works fine with {{site:site}}, but when using {{site:run}} and accessing one of the Asciidoc
generated pages we get the error below.
I saw that:
* The error occurs when trying to retrieve the instance of the MavenProject.
* Behavior is the same if I directly inject the MavenProject instead of using a provider.
That is, {{site:site}} works, {{site:run}} fails because it cannot find the instance.


Problem accessing /hello.html. Reason:

    Server Error

Caused by: Unable to provision, see the following errors:

1) Error in custom provider, Cannot access Key[type=org.apache.maven.project.MavenProject,
annotation=[none]] outside of a scoping block
  at org.apache.maven.execution.scope.internal.MojoExecutionScopeModule.configure(
(via modules: org.eclipse.sisu.wire.WireModule -> org.apache.maven.execution.scope.internal.MojoExecutionScopeModule)
  while locating org.apache.maven.project.MavenProject

1 error
	at org.apache.maven.doxia.DefaultDoxia.parse(

* How to reproduce:
# clone
# cd asciidoc-maven-site-example
# Access {{http://localhost:8080/hello.html}}

* Env:

$ mvn -v
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T21:00:29+02:00)
Maven home: /home/----/.sdkman/candidates/maven/current
Java version: 1.8.0_222, vendor: AdoptOpenJDK, runtime: /home/-----/.sdkman/candidates/java/8.0.222.hs-adpt/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.1.21-1-manjaro", arch: "amd64", family: "unix

This message was sent by Atlassian JIRA

View raw message