다른 프로젝트를 사용하는 "MyProject"라고하는 메이븐 프로젝트에 일반적인 메이븐 종속성으로 "MyDependency"라고 말합니다. MyDependency는 springframework, apache-commons, apache-camel 등과 같은 다른 의존성을 사용하는 maven 프로젝트입니다.내 maven 프로젝트에서 의존성 내부의 pom에서 종속성을 가져올 수 있습니까?
문제는 이것입니다. MyProject가 pom 파일에 다시 추가 할 필요없이 MyDependency 내부의 전이 의존성을 보길 원합니다. 나는 Maven-dependency plugin과 maven-jar plugin을 사용하여 아래의 것처럼 Jar 파일을 생성했다. Jar 파일은 종속 관계를 포함하고 있지만 결과는 없다.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>compile</includeScope>
<outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>lib/</Class-Path>
</manifestEntries>
</archive>
<finalName>core-${project.version}</finalName>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
이 할 수있는 방법이 있습니까? 또는 내 질문이 모두 잘못 되었습니까?
"전이성 의존성을 MyProject에서 보길 원합니다"라는 의미는 무엇입니까? 당신이 평범하지 않은 것을하지 않았다면, 이것은 밖으로 작동해야합니다. – Daniel
예 기본적으로 작동하도록되어 있지만 실제로는 일어나지 않습니다. –
'MyDependency'에 특정 범위를 사용하고 있습니까? – Daniel