Skip to content

Instantly share code, notes, and snippets.

@natansil
Last active February 9, 2019 16:02
Show Gist options
  • Save natansil/3f6f7bc0ede65307badde38dac272296 to your computer and use it in GitHub Desktop.
Save natansil/3f6f7bc0ede65307badde38dac272296 to your computer and use it in GitHub Desktop.
maven and bazel comparison
<project ... >
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
apply plugin: 'java'
version = '3.8.1'
group = 'org.apache.commons'
repositories {
mavenCentral()
}
dependencies {
testCompile "junit:junit:4.12"
testCompile "org.hamcrest:hamcrest-all:1.3"
}
// the project name can be found in 'settings.gradle' file
package(default_visibility = ["//visibility:public"])
java_library(
name = "commons_lang3",
srcs = glob(["*.java"]),
)
java_test(
name = "commons_lang3_tests",
test_class = "AllTests",
srcs = glob(["*.java"]),
deps = [
":commons_lang3",
# other information for 3rd party dependencies is defined in WORKSPACE file
"@junit_junit",
"@org_hamcrest",
],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment