Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven checksum pom setting?

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

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.

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?

like image 315
ogradyjd Avatar asked Dec 29 '22 06:12

ogradyjd


1 Answers

The install:install goal of the Maven Install Plugin has an optional createChecksum parameter that defaults to false.

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

mvn install -DcreateChecksum=true

Or in the plugin configuration:

<plugin>
  <artifactId>maven-install-plugin</artifactId>
  <version>2.3.1</version>
  <configuration>
    <createChecksum>true</createChecksum>
  </configuration>
</plugin>
like image 88
Pascal Thivent Avatar answered Jan 01 '23 09:01

Pascal Thivent