Issue
Background
I am using Java 11.0.3, Maven 3.6.2 and com.github.seahen.maven-s3-wagon 1.3.1.
I am using an s3 bucket as a maven repository. I have an internal jar artifact called dbclasses. I deploy dbclasses to the s3 maven repository using mvn source:jar deploy
.
I have a different maven project called secapps which uses the dbclasses artifact. Here is the relevant configuration related to the s3 bucket and the artifact in the secapps pom file
<repositories>
<repository>
<id>maven.nuvalence.repo.release</id>
<url>s3://ec-appdev-mvn-repo/release</url>
</repository>
<repository>
<id>maven.nuvalence.repo.snapshot</id>
<url>s3://ec-appdev-mvn-repo/snapshot</url>
</repository>
</repositories>
<build>
<extensions>
<extension>
<groupId>com.github.seahen</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.3.1</version>
</extension>
</extensions>
</build>
<dependencies>
<dependency>
<groupId>edu.excelsior</groupId>
<artifactId>dbclasses</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
Issue
Whenever I run a mvn clean package
on secapps it throws the following warning
[INFO] Downloading from maven.nuvalence.repo.release: s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom
[INFO] Logged in - ec-appdev-mvn-repo
[INFO] Downloading: s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom
[INFO] Downloading: s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom.sha1
[WARNING] Checksum validation failed, expected but is 38790b95f185a41908a1767ae2ad2b5bfe436773 from maven.nuvalence.repo.release for s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom
[INFO] Downloading: s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom
[INFO] Downloading: s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom.sha1
[WARNING] Could not validate integrity of download from s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom: Checksum validation failed, expected but is 38790b95f185a41908a1767ae2ad2b5bfe436773
[WARNING] Checksum validation failed, expected but is 38790b95f185a41908a1767ae2ad2b5bfe436773 from maven.nuvalence.repo.release for s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom
[INFO] Downloaded from maven.nuvalence.repo.release: s3://ec-appdev-mvn-repo/release/edu/excelsior/dbclasses/0.0.1/dbclasses-0.0.1.pom (4.7 kB at 2.8 kB/s)
[INFO] Logged off - ec-appdev-mvn-repo
You'll notice that it says Checksum validation failed, expected but is 38790b95f185a41908a1767ae2ad2b5bfe436773
In other words, the expected checksum is 38790b95f185a41908a1767ae2ad2b5bfe436773, but you've given me blank.
So I looked at the local repository and I see the following
You'll notice the following two things for each file
- For the pom and jar files there is an associated .part file
- the .part file contains all the data, but the non the actual files are empty
If the .part files are renamed to remove the .partXXXX everything works fine. But for some reason every time I try to build it keeps the .part files and leaves the normal files at 0K
Question
What are these .part files and why are my normal files 0K? How do I resolve this?
Attempts
I have tried many things including
- Manually deleting the dependency from my local repository
- Redeploying the dependency to s3
- Setting checksumPolicy to warning
- Setting updatePolicy to always
However, none of these seem to work. Does anyone have a solution for this? All the other dependencies from Maven central pull down fine. None of the dependencies form s3 work
Solution
You can use the latest version of seahen s3 wagon 1.3.3 because the previous versions of seahen wagon doesn't work properly with newest java versions. And also you need to add the suitable dependency to work that wagon properly. Add following wagon and dependency to pom.xml, delete all the previous builds in m2 as well as github file in m2 and try to reload project. That will resolve issue.
Wagon
<extension>
<groupId>com.github.seahen</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.3.3</version>
</extension>
Dependency
<dependency>
<groupId>com.github.seahen</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.3.3</version>
</dependency>
For further reference follow these links
https://github.com/seahen/maven-s3-wagonhttps://mvnrepository.com/artifact/com.github.seahen/maven-s3-wagon/1.3.3
Answered By - ManulMax
Answer Checked By - Marilyn (JavaFixing Volunteer)