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

No such property: maven.mainClass / Java/Maven build failures #2657

Closed
ottlinger opened this issue Dec 18, 2024 · 5 comments
Closed

No such property: maven.mainClass / Java/Maven build failures #2657

ottlinger opened this issue Dec 18, 2024 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@ottlinger
Copy link

Recently I experience build failures while running the codeql-java-autobuild:

  [2024-12-18 05:24:27] [autobuild] > /home/runner/work/mailclena/mailclena/./mvnw clean package -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Drat.skip=true -Dspotless.check.skip=true -s /home/runner/.m2/settings.xml -t /home/runner/.m2/toolchains.xml
  [2024-12-18 05:24:27] [autobuild] Picked up JAVA_TOOL_OPTIONS:  -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
  [2024-12-18 05:24:28] [autobuild] org.codehaus.plexus.classworlds.launcher.ConfigurationException: No such property: maven.mainClass
  [2024-12-18 05:24:28] [autobuild] 	at org.codehaus.plexus.classworlds.launcher.ConfigurationParser.filter(ConfigurationParser.java:355)
  [2024-12-18 05:24:28] [autobuild] 	at org.codehaus.plexus.classworlds.launcher.ConfigurationParser.parse(ConfigurationParser.java:114)
  [2024-12-18 05:24:28] [autobuild] 	at 

on project https://github.com/ottlinger/mailclena

As I do not configure any of the variables in
https://github.com/ottlinger/mailclena/blob/master/.github/workflows/codeql.yml
I wonder how to proceed.

Thanks

@aeisenberg
Copy link
Contributor

It looks like your codeql scans started failing on this commit: https://github.com/ottlinger/mailclena/actions/runs/11750645752 where you upgraded to mvn 4-beta-5.

In your codeql workflow you are using autobuild, which uses heuristics to try to build a project using standard build commands. I'm guessing that autobuild is trying to use an incorrect maven command.

The easiest thing to do is to use build-mode: none. It is a small change to your workflow.

@aeisenberg aeisenberg self-assigned this Dec 18, 2024
@aeisenberg aeisenberg added the question Further information is requested label Dec 18, 2024
@ottlinger
Copy link
Author

I assume the problem is somewhere in the autobuild script as it adds an unknown property:

[2024-12-18 05:24:28] [autobuild] org.codehaus.plexus.classworlds.launcher.ConfigurationException: No such property: maven.mainClass

The build is back in the green via ottlinger/mailclena@1d8dc07 but I assume that is not what you intended.

Thanks

@aeisenberg
Copy link
Contributor

That's another option. You're using an explicit build command. If that works for your repository, then there are no problems. I'll close this issue.

@ottlinger
Copy link
Author

I thought that you would include something on your side to not issue this parameter by default in Maven builds as it is incompatible with newer Maven versions .... but I'm fine if my build is back in the green :) Thanks again.

@aeisenberg
Copy link
Contributor

I'll discuss this with the team maintaining the Java extractor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants