advanced-security / maven-dependency-submission-action

GitHub Action for submitting Maven dependencies
MIT License
48 stars 24 forks source link

A potential issue with multi-module support #50

Closed fork52 closed 1 year ago

fork52 commented 1 year ago

I am using this action for a multi-module maven project (Repo is currently private).

As per the readme, I am expecting that that v3 is having multi-module support.

However, I am facing the following issue:

2023-10-22T08:51:42.3931636Z ##[warning]Error encountered executing maven: Unable to locate executable file: /home/runner/work/repo-name/repo-name/mvnw. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
2023-10-22T08:51:42.3955323Z 
2023-10-22T08:51:42.3955357Z 
2023-10-22T08:51:42.3956371Z ##[endgroup]
2023-10-22T08:51:42.3961595Z ##[error]Error: Failed to successfully generate reactor results with Maven, exit code: -1
2023-10-22T08:51:42.3967866Z ##[error]Error: A problem was encountered generating dependency files, please check execution logs for details; Failed to successfully generate reactor results with Maven, exit code: -1
2023-10-22T08:51:42.3974683Z ##[error]Failed to generate a dependency snapshot, check logs for more details, Error: A problem was encountered generating dependency files, please check execution logs for details; Failed to successfully generate reactor results with Maven, exit code: -1

Repo structure:

ROOT:
│   .gitignore
│   LICENSE
│   mvnw
│   mvnw.cmd
│   pom.xml
│   README.md
├───.github
│   └───workflows
│           maven.yml
├───.mvn
│   └───wrapper
│           maven-wrapper.jar
│           maven-wrapper.properties
└───module-name
    │   pom.xml
    ├───src

Am I missing something here ?

fork52 commented 1 year ago

Repo is public now: rx-codeforces-api-wrapper

peter-murray commented 1 year ago

Taking a look at your project, you are not referencing mvnw for the build step and relying on the actions runner installed mvn to invoke maven, this is event though you have a mvnw in your project.

This action, by default and unless you disable it via an input, will use any mvnw that is in your project as that is usually why users would have committed this file into their repository in the first place. If you wanted to ignore the wrapper file you have in the repository, then setting ignore-maven-wrapper to true will fix what you are seeing.

I have checked out your repository and the better way to solve this is to correct the execution bit on mvnw in your repository so as to make it runnable and then update your actions workflows to call mvnw instead of mvn otherwise there will still be inconsistencies.

The directory listing under linux of your repository showing the missing execution mask on the mvnw:

Image