在maven发布期间部署xml文件

时间:2015-01-16 12:56:32

标签: maven

在maven发布过程中,maven将尝试帮助您将source,javadoc和jar上传到nexus或ar​​tifactory,除了那些,我还想上传诸如xml文件之类的内容。

任何人都知道如何配置它? Maven部署插件看起来非常简单,不为用户提供这样的配置。

我是否应该使用部署文件目标?还是其他方式?

欢迎任何评论。

BR, 添

1 个答案:

答案 0 :(得分:2)

最简单的解决方案是使用build-helper-maven-plugin这样的:

<project>
  ...
  <build>
    <plugins>
      <plugin>
        <!-- add configuration for antrun or another plugin here -->
      </plugin>
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.9.1</version>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>some file</file>
                  <type>extension of your file </type>
                  <classifier>optional</classifier>
                </artifact>
                ...
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

您还可以创建一个单独的资源包,并通过其他项目中的maven-remote-resources-plugin使用它。

相关问题