1

Our users are maven agnostic so to provide a seamless solution. The idea was to provide .m2/settings.xml entries especially

<localRepository> .. <localRepository> and <proxy> ..</proxy>

Is that possible? As per the slightly older Stack Overflow post.

it is not possible. Yes it is NOT a best idea but is required because all are internal users and we share a same proxy settings. Yes to download the repositories no password or userid required.

Community
  • 1
  • 1
lifeline2
  • 69
  • 1
  • 15

1 Answers1

1

No, not possible. As stated here, the <localRepository> element can only appear inside the Maven settings. The same goes for the <proxy> element. You can convince yourself of that by seeing that Maven POM reference does not mention them.

What you can do is have a single settings.xml file, that you would distribute with your application, and specifically tell Maven to use those settings, with

mvn -s YourOwnSettings.xml clean install
Community
  • 1
  • 1
Tunaki
  • 132,869
  • 46
  • 340
  • 423
  • Thanks Tunaki it'll surely help but than we have to provide embedded maven or maven invoker or mojo executer and programmatically trigger the maven goals. Currently users are triggering the maven goals from UI which uses default embedded maven of m2e. – lifeline2 Feb 18 '16 at 12:30
  • @lifeline2 You can programmatically set the settings to use through Maven Invoker: see [here](https://maven.apache.org/plugins/maven-invoker-plugin/run-mojo.html#settingsFile). – Tunaki Feb 18 '16 at 12:33