使用Maven Install Plugin安装无扩展名构件遇异常,是否可行或属插件问题?
Maven无扩展名构件安装问题
我在网上深入调研后,未找到将无扩展名的新构件安装到Maven仓库的方法。
在Maven Install Plugin 2.5.2版本及之前,插件会将packaging值作为构件文件的扩展名,但MINSTALL-121议题修改了这一逻辑,不再使用packaging作为扩展名。由于我的构件是二进制可执行文件,尝试安装不带扩展名的构件,过程如下:
生成文件的POM配置
<resultFolder>${project.build.directory}${file.separator}bin${file.separator}mac</resultFolder> <resultName>${project.build.finalName}</resultName>
对应的实际文件路径:
/Users/rafaelruizpalacios/go/src/github.com/MidVision/rd/go/bin/mac/rdcli-1.2-SNAPSHOT
Install-file目标的POM配置
<execution> <id>install-mac</id> <phase>install</phase> <goals> <goal>install-file</goal> </goals> <configuration> <file>${project.build.directory}${file.separator}bin${file.separator}mac${file.separator}${project.build.finalName}</file> <groupId>${project.groupId}</groupId> <artifactId>${project.artifactId}-mac</artifactId> <version>${project.version}</version> <packaging>bin</packaging> </configuration> </execution>
不同版本插件的安装结果
- Maven Install Plugin 2.5.2:安装后的构件文件带有
.bin扩展名,路径为:/Users/rafaelruizpalacios/.m2/repository/com/midvision/plugins/rdcli-mac/1.2-SNAPSHOT/rdcli-mac-1.2-SNAPSHOT.bin - Maven Install Plugin 3.0.1(最新版):受MINSTALL-121逻辑影响,插件错误将文件名最后一个点后的
2-SNAPSHOT识别为扩展名,最终文件路径为:/Users/rafaelruizpalacios/.m2/repository/com/midvision/plugins/rdcli-mac/1.2-SNAPSHOT/rdcli-mac-1.2-SNAPSHOT.2-SNAPSHOT
疑问
安装无扩展名的构件是否不可行或不推荐?还是这属于插件的另一个问题?
内容的提问来源于stack exchange,提问作者Rafael Ruiz Palacios
相关产品推荐
相关产品推荐

