Our pproject is uberjar based project.
We tried to move out the project dependencies from the uberjar/m2repo folder.
For it, we set the thorntail maven plugin's bundleDependencies to false.
As the documentation says
If true, dependencies will be included in the -thorntail.jar file. Otherwise, they will be resolved from $M2_REPO or the network at runtime.
So, we though if we set the $M2_REPO eviroment variable, to the location of the dependencies (we tried the /opt/m2repo) it will works. But, doesn't :/
At continer starting, we get (as we wanted)
Dependencies not bundled; resolving from M2REPO.
message. (This message comes from org.wildfly.swarm.bootstrap.modules.MavenResolvers But always the container failed to start by not found dependencies.
We tried some ways (see below) but don't works none of them.
- We set the M2_REPO env variable, as the docs says.
- We set the M2REPO env variable, as the INFO massage says.
- We tried to set the maven.repo.local running param (-Dmaven.repo.local=/opt/M2REPO, as we found that in org.jboss.modules.maven.MavenArtifactUtil
The resolition was, to move all dependencies to ~/.m2/repositoy folder. Nor other folder, didn't work.