Java Maven是否可以在Maven项目中使用sources jar作为depdency
我想使用maven向gwt项目添加一个源jar 我试着这样做(它只是一个用于管理源依赖项的poc) 源jar pom:Java Maven是否可以在Maven项目中使用sources jar作为depdency,java,maven,jar,Java,Maven,Jar,我想使用maven向gwt项目添加一个源jar 我试着这样做(它只是一个用于管理源依赖项的poc) 源jar pom: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>test-source-dependencies</artifactId>
<groupId>com.niflheimcorp</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-source-jar</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.niflheimcorp</groupId>
<artifactId>test-utilisateur-jar</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.niflheimcorp</groupId>
<artifactId>test-source-jar</artifactId>
<classifier>source</classifier>
</dependency>
</dependencies>
</project>
但是这个工件是由maven在前面的步骤中安装的
[INFO] Installing C:\Users\CRSD2193\psf\G4R0C3_portaFixe\test-sources-dependenci
es\test-source-jar\target\test-source-jar-1.0-sources.jar到C:\Users\CRSD2193。
m2\repository\com\niflheimcorp\test source jar\1.0\test-source-jar-1.0-sources.j
ar
我看不出错误的原因,除非我们不能将源jar声明为builddeps
问候
Nemesis分类器源上的愚蠢输入错误(忘记了结尾的s:-/)。为什么要这样做?首先,源作为依赖项似乎很奇怪。接下来,分类器被称为
sources
而不是source
。分类器应该是sources
,带有s
。我想这样做是因为gwt需要源代码来编译,我讨厌在project webapp中复制源代码(代码复制+编译和声纳分析的奇怪排除)所以在这个上下文中,源jar作为依赖项并不像看上去那么奇怪。谢谢你指出我的错误,我在分类器上打错了,没有注意到:-/
[INFO] Installing C:\Users\CRSD2193\psf\G4R0C3_portaFixe\test-sources-dependenci