Maven 3站点描述符问题:部署工件不工作或站点未构建

时间:2011-09-13 19:20:21

标签: deployment maven artifact

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

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

2-我们如何在maven资源库上安装或部署site.xml。我尝试在我的父pom中添加以下xml,但它没有使用mvn install命令在我的本地存储库中安装任何东西。我的项目中有一个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

如果我手动将evolan-framework-superpom-6.14.2-site_en.xml放在我的本地仓库上,它可以工作,但这不是一个真正的解决方案

1 个答案:

答案 0 :(得分:2)

  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. 添加网址&amp;一个distributionManagement元素,告诉您计划部署它的位置。

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

  4. 如果您的父母没有这些,它将起作用。