[英]How to use class file instead of java file when compiling with maven
我们收到了更新的.class
文件,但没有收到项目的.java
文件。 如何确保在编译我们的maven pom
时使用这个新的 class 文件,并将其放置在正确的目录中而不影响项目?
提取 class 文件是非常不寻常的。 通常,您会得到一个 jar 并将其用作依赖项。 如果您有这样的 class 文件,我会手动将它们捆绑到 jar 文件中,然后使用适当的坐标(groupId,artifactId, 然后,您可以在pom.xml
它们作为依赖项引用。
Not sure if this is the best method, but i was able to accomplish using this class file as a replacement for.java and no.jar file being provided by adding this resource argument to the maven pom file.
<resource>
<directory>${project.basedir}/src/main/java/com/action/helper</directory>
<targetPath>${project.build.directory}/classes/com/action/helper</targetPath>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.