如何安装/部署make-maven-plugin编译的工件

时间:2011-03-05 16:48:56

标签: c maven-2 makefile

我正在使用make-maven-plugin构建一个用C语言编写的软件。我的目标是在运行mvn installmvn deploy时自动将源tarball和二进制工件安装和部署到Maven存储库。我目前的pom.xml看起来像这样:

<project>
  <groupId>myGroup</groupId>
  <artifactId>myProject</artifactId>
  <version>1.0</version>
  <packaging>pom</packaging>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>make-maven-plugin</artifactId>
        <version>1.0-beta-1</version>
        <configuration>
          <destDir>${project.build.directory}/dest</destDir>
          <workDir>${basedir}</workDir>
        </configuration>
        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>package</id>
            <phase>package</phase>
            <goals>
              <goal>make-dist</goal>
            </goals>
            <configuration>
              <skipDist>false</skipDist>
              <sourceArchive>${project.name}-${project.version}.tar.bz2</sourceArchive>
              <sourceArchivePath>${project.build.directory}</sourceArchivePath>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

当我打包项目时,我在目标目录中有以下文件:

  • myProject-2.0.bin(已编译的二进制工件)
  • myProject-2.0.tar.bz2(源焦油球)

运行mvn install时,创建的源tar球和POM文件将安装到本地maven存储库。如何告诉Maven还安装二进制文件?我不想手工复制它。

1 个答案:

答案 0 :(得分:2)

使用build-helper-maven-plugin

将二进制文件附加为工件