我在pom.xml文件中有以下依赖项,
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
我想将下载的jar文件保存到我指定的目录中。具体方法是什么?
答案 0 :(得分:1)
在构建POM部分中尝试此操作:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>copy</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>[your.dep.group.id]</groupId>
<artifactId>[your.dep.artifact.id]</artifactId>
<version>[your.dep.version]</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>[your.output.dir]</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>