How to add local .jar file dependency to build.gradle file?

So I have tried to add my local .jar file dependency to my build.gradle file: apply plugin: ‘java’ sourceSets { main { java { srcDir ‘src/model’ } } } dependencies { runtime files(‘libs/mnist-tools.jar’, ‘libs/gson-2.2.4.jar’) runtime fileTree(dir: ‘libs’, include: ‘*.jar’) } And you can see that I added the .jar files into the referencedLibraries folder here: … Read more

Dealing with “Xerces hell” in Java/Maven?

In my office, the mere mention of the word Xerces is enough to incite murderous rage from developers. A cursory glance at the other Xerces questions on SO seem to indicate that almost all Maven users are “touched” by this problem at some point. Unfortunately, understanding the problem requires a bit of knowledge about the … Read more

Differences between dependencyManagement and dependencies in Maven

What is the difference between dependencyManagement and dependencies? I have seen the docs at Apache Maven web site. It seems that a dependency defined under the dependencyManagement can be used in its child modules without specifying the version. For example: A parent project (Pro-par) defines a dependency under the dependencyManagement: <dependencyManagement> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> … Read more

Android Studio: Add jar as library?

I’m trying to use the new Android Studio but I can’t seem to get it working correctly. I’m using the Gson library to serialize/deserialize JSON-objects. But the library somehow isn’t included in the build. I had created a new project with just a MainActivity. Copied gson-2.2.3.jar in the /libs folder and added it as a … Read more

What’s the difference between implementation, api and compile in Gradle?

After updating to Android Studio 3.0 and creating a new project, I noticed that in build.gradle there is a new way to add new dependencies instead of compile there is implementation and instead of testCompile there is testImplementation. Example: implementation ‘com.android.support:appcompat-v7:25.0.0’ testImplementation ‘junit:junit:4.12’ instead of compile ‘com.android.support:appcompat-v7:25.0.0’ testCompile ‘junit:junit:4.12′ What’s the difference between them and … Read more

What exactly is a Maven Snapshot and why do we need it?

A snapshot version in Maven is one that has not been released. The idea is that before a 1.0 release (or any other release) is done, there exists a 1.0-SNAPSHOT. That version is what might become 1.0. It’s basically “1.0 under development”. This might be close to a real 1.0 release, or pretty far (right after the 0.9 release, for example). The difference between a “real” version and a … Read more