Laura G
Laura G

Reputation: 165

Is it possible to add dependencies in a pom.xml file?

My question may seem very simple but I did not know how to write it correctly ...

Here is my problem : I am testing an application using Cucumber and other libraries. To do that, I had to add different dependencies to the pom.xml file of the Maven project I am testing.

In order to use all the work I made for further projects, I am now trying to create a settings.xml file in order to configure all others Maven projects with this document (avoiding copy/paste for all the pom.xml files). The fact is I manage to create profiles (which eases a little the work) but I can't find a way to automatically include all the dependencies I need.

Is there an easy way to do that ?

I hope my question is clear, Thank you

Upvotes: 0

Views: 208

Answers (2)

Laura G
Laura G

Reputation: 165

Thank you all for your answers !! I think I will have no other solution than copy/paste each time all my dependencies then...

Regards

Upvotes: 0

Krzysztof Krasoń
Krzysztof Krasoń

Reputation: 27516

You can't add dependencies from settings.xml profiles. You need to add them in projects pom.xml files (or in the parent of those).

Upvotes: 1

Related Questions