Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven,将校验和文件保存在目标(构建)目录中_Maven_Checksum - Fatal编程技术网

Maven,将校验和文件保存在目标(构建)目录中

Maven,将校验和文件保存在目标(构建)目录中,maven,checksum,Maven,Checksum,我使用maven安装插件生成.war文件的校验和,但它们保存在本地maven repo中 <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.3.1</version> <configuration> <createChecksum>true</createChecksum> &

我使用maven安装插件生成.war文件的校验和,但它们保存在本地maven repo中

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

maven安装插件
2.3.1
真的
我需要的是:

1) 将校验和文件保存在我的目标生成目录中


2) 将生成的校验和文件从目标生成目录复制到另一个位置(使用maven dependency plugin?)。

我正在做类似的事情-以下是我目前的做法:

为了生成校验和,我使用了checksummaven插件。 下面是一个pom.xml代码段,它将在目标/目录中为在那里找到的所有.war文件生成.sha1校验和文件。 您可以调整
规范来更改哪些文件得到校验和,并且可以调整

  <plugin>
    <groupId>net.ju-n.maven.plugins</groupId>
    <artifactId>checksum-maven-plugin</artifactId>
    <version>1.3</version>
    <executions>
      <execution>
        <id>checksum-maven-plugin-files</id>
        <phase>package</phase>
        <goals>
          <goal>files</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <fileSets>
        <fileSet>
          <directory>${project.build.directory}</directory>
          <includes>
            <include>*.war</include>
          </includes>
        </fileSet>
      </fileSets>
      <algorithms>
        <algorithm>SHA-1</algorithm>
      </algorithms>
    </configuration>
  </plugin>