【问题标题】:Maven 3 site descriptor issue : deploying artifact not working or site not buildingMaven 3 站点描述符问题:部署工件不起作用或站点未构建
【发布时间】:2011-09-13 19:20:20
【问题描述】:

我已迁移到 maven 3.0.3,但无法构建 maven 站点。 事实上,我的项目使用了一个没有提供任何站点描述符作为工件的外部父 pom。

1- 即使父级不提供 site.xml ,是否有办法生成 maven 站点?我不能让它工作。 “mvn site”命令在尝试下载具有以下错误的父站点的 site.xml 时仍然崩溃(ArtifactResolutionException:无法找到站点描述符...)

2- 我们如何在 Maven 存储库中安装或部署 site.xml。我尝试在我的父 pom 中添加以下 xml,但它没有使用 mvn install 命令在我的本地 repo 中安装任何东西。我的项目中有一个 src/site/site.xml,我的项目是 pom 类型的项目 maven 站点插件 附加描述符 附加描述符

更新

不,它不工作 在我的 pom 中,我有

<url>${site_url_pattern}</url>

<distributionManagement>
<site>
<id>test</id>
<url>file://${baseDir}../maven-site</url>
</site>
</distributionManagement>

在插件管理中我放了

<plugin>
<!-- Site plugin -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<chmod>true</chmod>
<inputEncoding>${encoding}</inputEncoding>
<outputEncoding>${encoding}</outputEncoding>
</configuration>
</plugin>

在我放置的插件中

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<locales>en</locales>
<reportPlugins>
<!-- Manage site info part creation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin
</artifactId>
<version>2.2</version>
<configuration>
<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
<offline>true</offline>
</configuration>
<reports>
<report>cim</report>
<!-- Dependencies report are consuming resources set MAVEN_OPTS=-Xmx1024m if java heap <report>dependencies</report> <report>dependencies-convergence</report> <report>dependencies-management</report> -->
<report>index</report>
<report>issue-tracking</report>
<!-- pb time generation on licence report <report>license</report> -->
<report>mailing-list</report>
<report>plugin-management</report>
<report>project-team</report>
<report>scm</report>
<report>summary</report>
</reports>
</plugin>
</reportPlugins>
</configuration>
<executions>
<execution>
<id>attach-descriptor</id>
<goals>
<goal>attach-descriptor</goal>
</goals>
</execution>
</executions>
</plugin>

我在同一个项目中有一个 src/site/site.xml

当我做 mvn 网站时,我仍然有

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:si
te (default-site) on project ner-delivery: SiteToolException: The site descripto
r cannot be resolved from the repository: ArtifactResolutionException: Unable to
 locate site descriptor: Could not transfer artifact com.sopragroup.evolan:evola
n-framework-superpom:xml:site_en:6.14.2 from/to Artifactory (http://pdtinteg.ptx
.fr.sopra/artifactory/repo): Access denied to: http://pdtinteg.ptx.fr.sopra/arti
factory/repo/com/sopragroup/evolan/evolan-framework-superpom/6.14.2/evolan-frame
work-superpom-6.14.2-site_en.xml
[ERROR] com.sopragroup.evolan:evolan-framework-superpom:xml:6.14.2

如果我在本地存储库中手动放置一个 evola-framework-superpom-6.14.2-site_en.xml ,它就可以工作,但这不是一个真正的解决方案

【问题讨论】:

标签: deployment maven artifact


【解决方案1】:
  1. 在你的 pom 中显式配置 maven-site-plugin 3.0:

      <pluginManagement>
        <plugin>
               <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <chmod>true</chmod>
                    <inputEncoding>UTF-8</inputEncoding>
                    <outputEncoding>UTF-8</outputEncoding>
                </configuration>
            </plugin>
        </pluginManagement>
    
  2. 添加一个 url 和一个 distributionManagement 元素,告诉您计划在哪里部署它。

  3. 添加包含您需要的内容的 src/site/site.xml。

如果你的父母没有这些,它会起作用。

【讨论】:

    猜你喜欢
    • 2015-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-07
    • 2014-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多