Re: dependencyManagement BOM question

2016-08-23 Thread Christian Schulte
Am 08/23/16 um 21:27 schrieb David Hoffer:
> I have some questions regarding how importing a pom type dependency in my
> dependencyManagement section really works (e.g. BOM dependency).  At a
> basic level I understand it will effectively add all its dependencies
> defined in its dependencyManagement section to my dependencyManagement
> section.

Not all. Only the dependencies not already declared in your effective
dependency management. Implemented in class
'org.apache.maven.model.composition.DefaultDependencyManagementImporter'



based on method 'getManagementKey' of class
'org.apache.maven.model.Dependency'

.

> 
> However the imported pom uses variables for all the versions and defines
> them in its pom.  Now if I want to use a different version and also have
> the version variable (same variable name) set in my pom, which version will
> be used?

Maven imports the effective dependency management of the BOM (after
inheritance, interpolation, etc.). Consider the BOM a standalone project
without any relationship to the importing POM.

> 
> What about order of the BOM import?  Does the order of the BOM import
> matter with respect to other non imported dependencyManagement
> dependencies?  If my POM has the same dependency of the imported one which
> one will be used?  Lets say in one case I'm using a property variable to
> specify the version and also if I use a literal version.
> 

Effective dependencies of the POM override what gets imported. See
above. When using multiple BOM imports in the POM, the order of
declaration of those imports matter (after inheritance, interpolation,
etc.). As of Maven 3.4.0-SNAPSHOT you'll get a warning when your POM
depends on this "first declaration wins" itch. Relying on the order of
XML elements should be avoided.

Regards,
-- 
Christian


-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



dependencyManagement BOM question

2016-08-23 Thread David Hoffer
I have some questions regarding how importing a pom type dependency in my
dependencyManagement section really works (e.g. BOM dependency).  At a
basic level I understand it will effectively add all its dependencies
defined in its dependencyManagement section to my dependencyManagement
section.

However the imported pom uses variables for all the versions and defines
them in its pom.  Now if I want to use a different version and also have
the version variable (same variable name) set in my pom, which version will
be used?

What about order of the BOM import?  Does the order of the BOM import
matter with respect to other non imported dependencyManagement
dependencies?  If my POM has the same dependency of the imported one which
one will be used?  Lets say in one case I'm using a property variable to
specify the version and also if I use a literal version.

-Dave


How do I specify SOCKS Proxy in settings.xml

2016-08-23 Thread BARANSKI, MIKE
I have a SOCKS proxy that I need Maven to use when connecting to a certain 
mirror.



proxied.maven.central
proxied maven 
central

http://proxied-mvn-repo.mydomain.net:18080
*



I need something like the following to proxy, but can't figure out how to 
specify SOCKS:


socks_proxy
true
socks
myhost



 
localhost,127.0.0.1|mavencentral|somethingelse


If I use MAVEN_OPTS=" -DsocksProxyHost=localhost -DsocksProxyPort=" it 
works OK, but I want to be able to set it in my settings so my IDE can use it.  
The IDE (Eclipse) does not use the MAVEN_OPTS for some reason with the m2e 
plugin.

IMO, it would be even better if we could specify a proxy in the mirror 
definition, or have a corresponding proxyHosts tag in the proxy definition so 
we could explicitly include hosts to proxy instead of the other way around.

Thanks,
M.