Maven校验和pom设置? [英] Maven checksum pom setting?

查看:137
本文介绍了Maven校验和pom设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google让我失败了,即使在这里我也找不到答案-让我真正在这里发布我的第一个问题.

Google has failed me and I can't find an answer even here on SO - relegating me to actually posting my first question here.

我正在尝试获取命令"mvn install"以自动生成工件的校验和,并将校验和与工件一起正确地放置在存储库中.我读过的所有内容似乎都表明它应该在没有我干预的情况下发生,但是我所得到的只是工件,源zip,pom和本地元数据xml.

I'm trying to get the command "mvn install" to automatically generate the checksums for the artifacts and place the checksums in the repository right along with the artifacts. Everything I've read seems to indicate it should be happening without my intervention, but all I'm getting is the artifact, a source zip, a pom, and the local metadata xml.

该项目的pom如下所示:

The pom for the project looks like this:

<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>

我确定答案很简单,但是我不知道自己在做什么错.任何人都想回答这个垒球吗?

I'm sure the answer is something simple, but I can't figure what I'm doing wrong. Anyone want to answer this softball?

推荐答案

createChecksum 参数,默认为false.

在命令行中将其设置为true(如创建校验和):

Either set it to true on the command line (as documented in Creating Checksums):

mvn install -DcreateChecksum=true

或在插件配置中:

<plugin>
  <artifactId>maven-install-plugin</artifactId>
  <version>2.3.1</version>
  <configuration>
    <createChecksum>true</createChecksum>
  </configuration>
</plugin>

这篇关于Maven校验和pom设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆