SoftwareEntwicklung Beratung Schulung

A coders, hackers heaven.....Hm...I do not think so...

Apache Maven Artifact Resolver 1.3.1 Released

The Apache Maven team is pleased to announce the release of the Apache Maven Resolver, version 1.3.1

Apache Maven Artifact Resolver is a library for working with artifact repositories and dependency resolution.

Maven Artifact Resolver deals with the specification of local repository, remote repository, developer workspaces, artifact transports and artifact resolution.

It is expected to be extended by concrete repository implementation, like Maven Artifact Resolver Provider for Maven repositories or any other provider for other repository formats.

You can download the appropriate sources etc. from the download page.

Apache Maven Surefire Plugin Version 2.22.1 Released

The Apache Maven team is pleased to announce the release of the Apache Maven Surefire Plugin, version 2.22.1.

The release contains 17 bug fixes. Again we received contributions from the community in form of bug reports and bug fixes. Thank you and keep them coming!

You should specify the version in your project’s plugin configuration:

1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.22.1</version>
</plugin>

or for failsafe:

1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <version>2.22.1</version>
</plugin>

or for surefire-report:

1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-report-plugin</artifactId>
  <version>2.22.1</version>
</plugin>

Maven Artifact Checksums - What?

If you are using Apache Maven you might have faced with issues like this:

1
2
3
4
5
6
7
8
9
10
11
12
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.1:shade (default) on project cores-batch: Error creating shaded jar: invalid LOC header (bad signature) -> [Help 1]
...
.... (remove many lines for brevity).
...
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
    at java.util.zip.ZipFile.read(Native Method)
    at java.util.zip.ZipFile.access$1400(ZipFile.java:56)
    at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:679)
    at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:415)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
    at java.io.FilterInputStream.read(FilterInputStream.java:107)
...

How could that happen? Most of the time these are downloading/network issues which are causing something like this. In extreme rare cases it might also be a hardware error (But usually I have my doubts about that). This means the downloaded artifacts are not correctly downloaded or downloaded from repositories which do not exist anymore. Or any other strange thing you could imagine. If you have artifacts which contain html snippets this is an indicator that you are trying to download artifacts from repositories which do not exist anymore. This means you have to check you configuration for your used repositories which is obviously wrong.

So now the question is: What can you do to prevent that in the furture?

If you take a look on Stackoverflow related to that. More or less all answers will tell you to delete your local cache $HOME/.m2/repositoy and rebuild. This is unfortunately only a try to fix a symptom but not the real cause. So work begins with deleting the locale cache as a first step.

And now the very important part:

You have to configure Maven to check the checksums of the downloaded artifacts and fail your build if they are not correct. This is called checksum policy which I strongly recommend to use.

This means you have to change the configuration in your settings.xml. This means you have to change the checksum policy in your settings.xml. A temporary solution would be to call maven with: --strict-checksums which exactly does this but only for the appropriate call of Maven and not always. So it is better to configure this into your settings.xml which will look like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
  ...
  <profiles>
    <profile>
      ...
      <repositories>
        <repository>
          <id>codehausSnapshots</id>
          <name>Codehaus Snapshots</name>
          <releases>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
          <url>...</url>
        </repository>
      </repositories>
      <pluginRepositories>
        ...
      </pluginRepositories>
      ...
    </profile>
  </profiles>
  ...
</settings>

Furthermore you have to configure this for all of your repositories in your settings.xml. If you are using a repository manager either locally or within a corporate environment. You have to check your repository manager as well if it is correctly configured to check the checksums. You should of course not forget to check if you are downloading via https:// instead of http:// from all of your remote repositories.

Apache Maven Artifact Resolver 1.3.0 Released

The Apache Maven team is pleased to announce the release of the Apache Maven Resolver, version 1.3.0

Apache Maven Artifact Resolver is a library for working with artifact repositories and dependency resolution.

Maven Artifact Resolver deals with the specification of local repository, remote repository, developer workspaces, artifact transports and artifact resolution.

It is expected to be extended by concrete repository implementation, like Maven Artifact Resolver Provider for Maven repositories or any other provider for other repository formats.

You can download the appropriate sources etc. from the download page.

Apache Maven Deploy Plugin Version 3.0.0-M1 Released

The Apache Maven team is pleased to announce the release of the Apache Maven Deploy Plugin, version 3.0.0-M1.

The deploy plugin is primarily used during the deploy phase, to add your artifact(s) to a remote repository for sharing with other developers and projects. This is usually done in an integration or release environment. It can also be used to deploy a particular artifact (e.g. a third party jar like Sun’s non redistributable reference implementations).

Important Note since 3.0.0-M1:

  • Maven 3.X only
  • Minimum JDK 7+
  • The maven-deploy-plugin will generate the needed checksums during the transfer to your remote repository.

Usage Note:

  • Use the maven-deploy-plugin version 3.0.0-M1 only in combintation with the maven-install-plugin version 3.0.0-M1.
1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-deploy-plugin</artifactId>
  <version>3.0.0-M1</version>
</plugin>

You can download the appropriate sources etc. from the download page.

Apache Maven Install Plugin Version 3.0.0-M1 Released

The Apache Maven team is pleased to announce the release of the Apache Maven Install Plugin, version 3.0.0-M1.

The Install Plugin is used during the install phase to add artifact(s) to the local repository. The Install Plugin uses the information in the POM (groupId, artifactId, version) to determine the proper location for the artifact within the local repository.

Important Note since 3.0.0-M1:

  • Maven 3.X only
  • Minimum JDK 7+
  • The maven-install-plugin does not generate any kind of checksum anymore.

Usage Note:

  • Use the maven-install-plugin 3.0.0-M1 only in combination with the maven-deploy-plugin 3.0.0-M1.
1
2
3
4
5
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-install-plugin</artifactId>
  <version>3.0.0-M1</version>
</plugin>

You can download the appropriate sources etc. from the download page.

Apache Maven JXR Plugin Version 3.0.0 Released

The Apache Maven team is pleased to announce the release of the Apache Maven JXR, version 3.0.0.

This module generates browsable HTML pages from Java source code.

You should specify the version in your project’s plugin configuration:

1
2
3
4
5
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-jxr-plugin</artifactId>
   <version>3.0.0</version>
</plugin>

NOTE: Special thanks for the contributions retrieved during the hackathon at JCreate.

Apache Maven Parent POM Version 33 Released

The Apache Maven team is pleased to announce the release of the Maven Parent POMs Version 33

Maven Parent POMs include Maven Parent POM itself, but also Maven Plugins Parent POM, Maven Shared Components Parent POM, Maven Skins Parent POM and Maven Doxia Tools Parent POM.

https://maven.apache.org/pom/maven/

You should specify the version in your project as parent like the following:

1
2
3
4
5
<parent>
   <groupId>org.apache.maven</groupId>
   <artifactId>maven-parent</artifactId>
   <version>33</version>
</parent>

You can download the appropriate sources etc. from the download page:

https://maven.apache.org/pom/maven/download.html

Apache Maven SCM Version 1.11.1 Released

The Apache Maven team is pleased to announce the release of the Apache Maven SCM, version 1.11.1.

Maven SCM supports Maven 2.x plugins (e.g. maven-release-plugin) and other tools (e.g. Continuum) by providing them with a common API for doing SCM operations. You can look at the list of SCMs for more information on using Maven SCM with your favorite SCM tool.