Maven goal for dependencies

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Maven goal for dependencies

Milan Tomic
Hello
I have a Maven Java project which produces a JAR (packaging = JAR). I am using external SonarQube scanner to scan my source code (SonarQube is not configured inside pom.xml). I am first building my project using "mvn clean package", then I execute SonarQube Scanner on it.
The issue is that SonarQube requires my project's dependencies to be on the path in order to properly scan my code. So, I need some Maven goal which will collect all dependencies in my project and place them inside of the /lib folder. Which Maven goal should I use?
Final result should be /lib folder containing apache, spring... dependencies.
Thank you in advance,Milan
Reply | Threaded
Open this post in threaded view
|

Re: Maven goal for dependencies

Oliver B. Fischer-2
mvn dependency:copy-dependencies might be your friend...

https://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html

Am 11.11.20 um 10:16 schrieb Milan Tomic:
> Hello
> I have a Maven Java project which produces a JAR (packaging = JAR). I am using external SonarQube scanner to scan my source code (SonarQube is not configured inside pom.xml). I am first building my project using "mvn clean package", then I execute SonarQube Scanner on it.
> The issue is that SonarQube requires my project's dependencies to be on the path in order to properly scan my code. So, I need some Maven goal which will collect all dependencies in my project and place them inside of the /lib folder. Which Maven goal should I use?
> Final result should be /lib folder containing apache, spring... dependencies.
> Thank you in advance,Milan

--
N Oliver B. Fischer
A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany
P +49 30 44793251
M +49 178 7903538
E [hidden email]
S oliver.b.fischer
J [hidden email]
X http://xing.to/obf


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Maven goal for dependencies

Karl Heinz Marbaise-3
In reply to this post by Milan Tomic
On 11.11.20 10:16, Milan Tomic wrote:
> Hello
> I have a Maven Java project which produces a JAR (packaging = JAR). I am using external SonarQube scanner to scan my source code (SonarQube is not configured inside pom.xml). I am first building my project using "mvn clean package", then I execute SonarQube Scanner on it.
> The issue is that SonarQube requires my project's dependencies to be on the path in order to properly scan my code. So, I need some Maven goal which will collect all dependencies in my project and place them inside of the /lib folder. Which Maven goal should I use?
> Final result should be /lib folder containing apache, spring... dependencies.
> Thank you in advance,Milan

will handle that on plain command line without copying dependencies etc.
you might need to configure the sonar host/branch/login via the given
properties:

mvn clean verify \
   -Dsonar.host.url=URL \
   -Dsonar.login=SONARTOKEN \
   -Dsonar.branch.name=NAME \
   org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar


Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]