我们正在使用maven 2.1.0.我有多个完全独立的模块,但仍有许多常见的依赖项.像log4J,但有些模块不需要它.我想知道在该<dependencyManagement>部分中的一个父文件中声明所有公共依赖项是否是一个好主意,还是有更好的方法来处理它?
关于的后续问题<dependencyManagement>.如果我<dependencyManagement>在父项的部分中声明Log4J 并且子项目不使用它,那么它是否会被包括在内?
我正在尝试将 war 文件从公司的 Nexus 存储库复制到特定位置。我按以下方式使用maven-dependency-plugin :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>copy-to-output</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.mycompany</groupId>
<artifactId>myproduct</artifactId>
<version>2.3.0</version>
<type>war</type>
<overWrite>false</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${basedir}/src/main/output</outputDirectory>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
当我尝试使用<version>RELEASE</version>而不是特定版本(或根本没有版本)以获得最新的发行版本(虽然不是最佳实践,但在这种情况下它是安全的)时,问题就出现了 - 它不起作用。有什么想法吗?