Maven install changes jar
I use external program,that creates jar. The code for this operation follows:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<property environment="env" />
<property name="appname" value="hellojavaworld" />
<echoproperties />
<exec dir="" executable="respawn.exe" searchpath="true">
<arg value="${basedir}srcmainjava${appname}.app" />
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
The created jar is produced by respawn.exe which is later on used in a building process. I wanted to use the most proper way which is to install 3rd party jar to local maven repository. For this purpose it is used the command:
mvn install:install-file -Dfile...
This works as designed. I wanted to create pom.xml file that will be used during the building (parent-child), so the created jar will be copied to local maven repository. I am not able to do it, because maven creates own jar that is copied to local repository. Question is how to change maven to use different jar? I do not want to copy jar that creates maven,because it is different than the jar created by respawn.exe.
Jar comparison This link depicts the difference of these jars. You can see that jar on the right side (maven local repository) misses the abc folder with the appropriate classes.
Question is why?
Maven will compile the Java source files ( *.java
) from src/main/java
into target/classes
. These classes will be packaged into the jar, by Maven.
PS Here just the Maven default locations are shown.
Looking at your question, it seems, you have no Java source files.
链接地址: http://www.djcxy.com/p/29666.html上一篇: 无法从maven中的已安装jar加载类
下一篇: Maven安装更改jar