如何安装/部署由 make-maven-plugin 编译的工件
<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 (已编译的二进制工件)
- -2.0.tar.bz2 (源 tar 球)
myProject 运行 mvn install
然后创建的源 tar 包和 POM 文件将安装到本地 maven 存储库。我如何告诉 Maven 也安装二进制文件?我不想用手复制它。
I'm using the make-maven-plugin to build a software written in C with Maven. My goal is to automatically install and deploy the source tarball AND the binary artifact to the Maven repository when I run mvn install
and mvn deploy
. My current pom.xml looks like this:
<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>
When I package the project then I have the following files in the target directory:
- myProject-2.0.bin (The compiled binary artifact)
- myProject-2.0.tar.bz2 (The source tar ball)
When running mvn install
then the created source tar ball and the POM file is installed to the local maven repository. How can I tell Maven to also install the binary file? I don't want to copy it by hand.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 build-helper-maven 将二进制文件附加为工件-插件
Attach the binary file as an artifact using build-helper-maven-plugin