Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0

UPDATE Microsoft now provide this artifact in maven central. See @nirmal’s answer for further details: https://stackoverflow.com/a/41149866/1570834 ORIGINAL ANSWER The issue is that Maven can’t find this artifact in any of the configured maven repositories. Unfortunately Microsoft doesn’t make this artifact available via any maven repository. You need to download the jar from the Microsoft website, … Read more

Retrieve version from maven pom.xml in code

Assuming you’re using Java, you can: Create a .properties file in (most commonly) your src/main/resources directory (but in step 4 you could tell it to look elsewhere). Set the value of some property in your .properties file using the standard Maven property for project version: foo.bar=${project.version} In your Java code, load the value from the … Read more

gradle – library duplicates in dependencies

To find duplicate dependencies or its required dependencies, you can visualize library dependencies in tree. Execute gradle command as below. gradle -q dependencies yourProject:dependencies –configuration compile Note that, run gradlew in Windows as below. gradlew -q dependencies yourProject:dependencies –configuration compile The command result will show you human-readable tree hierarchy of all dependencies as below. compile … Read more

How to run Maven from Java?

A simple invocation API : maven-invoker. Project documentation : http://maven.apache.org/shared/maven-invoker/ Usage : http://maven.apache.org/shared/maven-invoker/usage.html InvocationRequest request = new DefaultInvocationRequest(); request.setPomFile( new File( “/path/to/pom.xml” ) ); request.setGoals( Arrays.asList( “clean”, “install” ) ); Invoker invoker = new DefaultInvoker(); invoker.execute( request );