谷歌让我失望了,即使在这里我也找不到答案 - 让我真的在这里发布我的第一个问题。
我正在尝试获取命令“mvn install”以自动生成工件的校验和,并将校验和与工件一起放在存储库中。我读过的所有内容似乎表明它应该在没有我介入的情况下发生,但我得到的只是工件,源zip,pom和本地元数据xml。
项目的pom看起来像这样:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.pkg.name</groupId>
<artifactId>Logging</artifactId>
<version>1.2.0-SNAPSHOT</version>
<build>
<sourceDirectory>src/java</sourceDirectory>
<testSourceDirectory>test/java</testSourceDirectory>
<resources>
<resource>
<directory>src/conf</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>test/conf</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<debug>true</debug>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.4</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6.SEC02</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
我确信答案很简单,但我无法弄清楚我做错了什么。有人想回答这个垒球吗?
答案 0 :(得分:9)
Maven Install Plugin的install:install
目标有一个可选的createChecksum
参数,默认为false
。
在命令行上将其设置为true
(如Creating Checksums中所述):
mvn install -DcreateChecksum=true
或者在插件配置中:
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<createChecksum>true</createChecksum>
</configuration>
</plugin>