Maven builds failing to download artifact on Github, works locally

I have an action on my project that performs a build whenever a commit is pushed to our develop branch.

As of this weekend, that action is randomly failing during the build/test phase. And normally the failure is for the same artifact: file-management 3.0.0

I’ve sat an watched the build run and Github will sit on the following line for a very long time:

[INFO] --- jacoco-maven-plugin:0.8.5:report (report) @ comixed-library ---
[INFO] Loading execution data file /home/runner/work/comixed/comixed/comixed-library/target/jacoco.exec
[INFO] Analyzed bundle 'comixed-library' with 56 classes
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ comixed-library ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/shared/file-management/3.0.0/file-management-3.0.0.pom

Then, ultimately, the build times out and fails.

But this same build runs flawlessly locally, including downloading the artifact (tested by deleting my local repo and running a full build). What’s confusing to me is that this isn’t even a dependency of my project, at least not a direct or indirect on according to mvn dependency:tree.

What can I do to fix this?

@mcpierce,

What’s confusing to me is that this isn’t even a dependency of my project, at least not a direct or indirect on according to mvn dependency:tree.

The “jacoco-maven-plugin:0.8.5” and “maven-jar-plugin:3.2.0” are some plugins for Maven, and generally the plugins are defined in the pom.xml of the Maven packages.
plugins
Have you checked the pom.xml in your project?
And the situations below may also cause some plugins undefined in the pom.xml to be installed.

  • The default plugins required by Maven.
  • The plugins required by other plugins.

In addition, if possible, please share your repository with us so that we can check more detailed configurations in your project to analyze the root cause.

Sure, thanks for the response! Our project repository is here.

I was ultimately able to work around the issue by adding caching to our workflow so that it didn’t go back out every time to download the maven artifact with each build.

1 Like

@mcpierce,

I forked your repository and tested on my side, however I did not reproduce the issue as you mentioned above. This may be a temporary problem.

Yes, using caching is a good way when the reused files are not changed often between jobs or workflow runs, and it also can speed up the time to download and install the dependencies.

1 Like