Sorry if the question was already answered, I didn't understand the other threads.
I have a springboot project that have maven dependency on 2 java projects packaged as jboss-sar on our repository.
The problem is that when I put the dependency in the pom, it doesn't download the sources and my project doesn't compile because of many NoClassFound errors.
My solution was to use maven-shade-plugin to build a uber-jar from the 2 SAR projects.
In the pom I have the dependencies to the 2 SAR projects
then
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<!--filters>
<artifact>*.*</artifact>
<includes>
<include>**/*.class</include>
</includes>
</filters-->
<artifactSet>
<includes>
<include>${project.groupId}}:${project.artifactId}</include>
</includes>
</artifactSet>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/sarl</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
Old : [ The problem now is that, if I use the phase initialize, the main artifact is not built so the uber-jar failed to build. If I use the phase package, my project doesn't compile because of missing dependencies.
Is there a way to first build the uber-jar and then build the whole project? ]
UPDATE : I found an error in my pom so I can update my post. Currently if I do a mvn clean install I encounter no problem, the project compile. But then if I run my SpringBoot application it fails to launch because of ClassNotFound exceptions. All the classes that are in the project jboss-sar, are not found by Spring. Only maven manages to compile my project, even Intellij draws me redlines everywhere the classes are used because it doesn't find the classes in the classpath. How can I use this maven shade plugin to have actually the classes of the jboss-sar in my classpath?
it doesn't download the sources? The sources are not downloaded by default because the jar's are the parts which are required...-sources......