首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven checksum pom设置?

Maven checksum pom设置?
EN

Stack Overflow用户
提问于 2010-10-05 23:45:59
回答 1查看 12.3K关注 0票数 4

谷歌让我失望了,我甚至在这里也找不到答案--这让我不得不在这里发布我的第一个问题。

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

该项目的pom如下所示:

代码语言:javascript
复制
<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>

我确信答案很简单,但我不知道我做错了什么。有人想回答这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-10-06 05:01:08

Maven Install插件的install:install目标有一个可选的createChecksum参数,该参数缺省为false

在命令行中将其设置为true (如Creating Checksums中所述):

mvn安装-DcreateChecksum=true

或者在插件配置中:

代码语言:javascript
复制
<plugin>
  <artifactId>maven-install-plugin</artifactId>
  <version>2.3.1</version>
  <configuration>
    <createChecksum>true</createChecksum>
  </configuration>
</plugin>
票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3865343

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档