Cannot run exec:java because of classpath problems.

Dear all,

I have a multi-module maven build and I need to perform the following operatons

- Running a clean install -PmyProfile on the top level pom
- Running inside a \submodule1\subsubmodule2\ an exec:java

There is apparently a classpath problem that results in a ClassNotFoundException. If I run the same steps launching maven from the command line, everything works fine

3 comments
Comment actions Permalink

Have you (or anyone) managed to fix that?

I'm just struggling with `ClassNotFoundException` for regular maven exec, which runs just fine locally from commandline...

0
Comment actions Permalink

Hi Wojtek,

 

If it works locally, most of the time is an environment issue. Something missing on the build agent, or the user running the process not having enough permissions. We have instructions for troubleshooting this kind of issues here, please follow them: https://www.jetbrains.com/help/teamcity/common-problems.html#CommonProblems-BuildworkslocallybutfailsormisbehavesinTeamCity

0
Comment actions Permalink

Hi, I've managed to troubleshoot it a while back - sorry for not updating the ticket. Details here: https://stackoverflow.com/a/57383945/211453

copy-paste:

Everything boiled down to quotes in `Additional Maven command line parameters:` - TC passes them as parameters so `-Dexec.mainClass="some.package.Class" became `"some.package.Class"` in maven (instead of `some.package.Class`)

I finally noticed it when I was comparing debug from local na remote run:

* remote:
```
[DEBUG] joining on thread Thread["my.package.SummaryGenerator".main(),5,"my.package.SummaryGenerator"]
```
* local:
```
[DEBUG] joining on thread Thread[my.package.SummaryGenerator.main(),5,y.package.SummaryGenerator]
```

 

IMHO it could be sensible to handle it better...

0

Please sign in to leave a comment.