Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: cannot retrieve version information for pom outside work directory #1

Closed
mattdibi opened this issue Jun 28, 2022 · 3 comments · Fixed by #2
Closed

Bug: cannot retrieve version information for pom outside work directory #1

mattdibi opened this issue Jun 28, 2022 · 3 comments · Fixed by #2
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mattdibi
Copy link

Hi there,
as per title we found an issue with this action when used with a repo with a pom.xml outside the work directory.
It reports:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli): Goal requires a project to execute but there is no POM in this directory (/home/runner/work/repo/repo). Please verify you invoked Maven from the correct directory. -> [Help 1]

even though the pom.xml path was specified.

There seems to be a bug in the action sources as the pom.xml path is set but not used..

I think the proper fix would be something like:

runs:
  using: composite
  steps:
    - id: resolve-version
      shell: bash
      run: "echo \"::set-output name=resolved-version::\
        $(mvn -Dexec.executable=echo -Dexec.args='${project.version}' -f ${{inputs.pom}} --non-recursive exec:exec --quiet)\""
@JarvisCraft JarvisCraft self-assigned this Jun 28, 2022
@JarvisCraft JarvisCraft added the bug Something isn't working label Jun 28, 2022
@JarvisCraft JarvisCraft added this to the 1.0.1 milestone Jun 28, 2022
JarvisCraft added a commit that referenced this issue Jun 28, 2022
@JarvisCraft
Copy link
Contributor

JarvisCraft commented Jun 28, 2022

Thanks for reaching out,
For some reason I've forgotten to use this input parameter :D

I've commited a fix at GH-1 branch.

Could you please check it and tell if it resolves your issue?

@JarvisCraft JarvisCraft added the question Further information is requested label Jun 28, 2022
@JarvisCraft JarvisCraft linked a pull request Jun 28, 2022 that will close this issue
@mattdibi
Copy link
Author

Hi @JarvisCraft,

thanks for the quick feedback.

Looks like it's working:

Screenshot 2022-06-29 at 12 02 00

This is what I was getting before:

Screenshot 2022-06-29 at 12 02 24

I just changed the action reference:
Screenshot 2022-06-29 at 12 04 33

@JarvisCraft
Copy link
Contributor

I've released the fix under v1.0.1 tag

@JarvisCraft JarvisCraft reopened this Jun 29, 2022
@JarvisCraft JarvisCraft removed the question Further information is requested label Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants