Docker / K8S和Maven非常新。这就是我所坚持的。我有一个jar文件 my-artifact.jar ,我想在我公司的maven repo上传。然后使用maven构建过程想要将该jar下载到“目标”文件夹中。从该目标文件夹我想将其添加到docker镜像。
到目前为止,我能够将jar上传到maven repo并且maven构建过程能够下载但是会出现此错误:
[ERROR] Failed to parse plugin descriptor for com.abc.dde:my-artifact:1.0
(/home/johna/.m2/repository/com/abc/dde/my-artifact/1.0/my-artifact-1.0.jar):
No plugin descriptor found at META-INF/maven/plugin.xml -> [Help 1]
将jar作为“jar”类型上传到maven repo。以下是我的pom文件的样子:
<plugin>
<groupId>com.abc.dde</groupId>
<artifactId>my-artifact</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>target</outputDirectory>
<encoding>UTF-8</encoding>
<artifactItems>
<artifactItem>
<groupId>com.abc.dde</groupId>
<artifactId>my-artifact</artifactId>
<version>1.0</version>
<destFileName>my-artifact.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>