質問

I have small maven project. I'm trying to add generating site by maven-site-plugin, but it doesn't work. When I'm building this project i get following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project server-wms-product: SiteToolException: The site descriptor cannot be resolved from the repository: ArtifactResolutionException: Unable to locate site descriptor: Could not transfer artifact [PARENT-PROJECT]:xml:site_en:1.0.141.1 from/to eclipse (http://maven.eclipse.org/nexus/content/repositories/testing/): Connection to http://maven.eclipse.org refused

My project is extension for other project, so in my pom.xml is set parent project which isn't mine and I can't add site configuration there.

So is there any chance to skip checking parent project's site in site generation?

My pom.xml looks like this:

   <project>
       <parent>
        <artifactId>base-server-product</artifactId>
        <groupId>XXXXXXXXXXXx</groupId>
        <version>1.0</version>
    </parent>
        <build>
             <plugins>
                <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-site-plugin</artifactId>
                   <version>3.3</version>
                   <configuration>
                      <reportPlugins>
                      </reportPlugins>
                   </configuration>
                </plugin>
             </plugins>
       </build>
    </project>

And of course i have site.xml file in src/site.

役に立ちましたか?

解決 2

I have the exact same problem, and after much googling, came across this article which solved my problem:

http://amanica.blogspot.com/2010/08/archiva-gives-maven-site-plugin-invalid.html?m=1

Basically you want to add a basic site_en.xml to /src/site/ folder in your parent pom.xml.

他のヒント

Configure attaching the site descriptor to the artifacts in the parent pom.

<project>
  <artifactId>base-server-product</artifactId>
  <groupId>XXXXXXXXXXXx</groupId>
  <version>1.0</version>
  ...
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-descriptor</id>
            <goals>
              <goal>attach-descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>

Core functionality has been separated from site generation in maven 3. You can find the reasons here. If you want to refer to the parent module's site from the submodule, you have to attach the site.xml to the deployed artifacts.

For a reason I can't fathom, with me, it was enough to run maven in offline mode once.

I came across this question when working on an open source project I don't own where I wanted to submit an update to a site being generated in this manner. I wanted to test and view the change locally, but kept hitting this error.

User @Frischling alluded to this above (credit to them). It turns out what I wanted was not to edit any existing information or update any pom.xml files, but just build entirely in offline mode.

I was trying to run this command and it was failing with the error the original poster mentioned:

mvn site

To do this build offline instead, execute the following commands:

# Download the dependencies for the target
mvn dependency:go-offline site

# Build the target offline
mvn --offline site

Then the output got correctly generated to the target/site directory like I expected.

It's not ideal if you own the project or part of the project, but for a case like mine where I owned none of it, it was the perfect option.

The previous answers didn't work for me.

But Mark's one, here, solved the issue I had: https://stackoverflow.com/a/57429991/5056068

Etienne

I met the error like below, and I think it's because of checking parent project site xml either.

However I think org.springframework.boot:spring-boot-starter-parent:xml:site_en:2.7.4 is mvn site splicing from parent project like spring-boot-starter-parent and version 2.7.4 and default language en, so the mvn repostiory wouldn't found this xml forever.

And refer to last two answer, you can use mvn --offline site to generate a empty xml in your local repository.

The first mvn --offline site would return the same error and generate the xml.

Then you can use mvn site free to avoid checking parent project.

SiteToolException: The site descriptor cannot be resolved from the repository: ArtifactResolutionException: Una
ble to locate site descriptor: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:xml:site_en:2.7.4
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top