在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mdietrichstein/gradle-offline-dependencies-plugin开源软件地址(OpenSource Url):https://github.com/mdietrichstein/gradle-offline-dependencies-plugin开源编程语言(OpenSource Language):Groovy 100.0%开源软件介绍(OpenSource Introduction):Gradle Offline Dependencies PluginThis plugin resolves your project dependency artifacts (jar, javadoc, pom, etc.), including transitive ones, and stores them alongside your code. This way you can always build your project without having to fetch dependencies from remote servers. Tested with Gradle 5.1 How to integrateAll Gradle versions:
For Gradle >= 2.1:
UsageThe plugin creates a local maven repository where all dependency artifacts will be stored for offline use. To use this repository, add the following: repositories {
maven {
url offlineRepositoryRoot
}
} The Next, configure the repositories you want do fetch dependencies from: offlineDependencies {
repositories {
mavenCentral()
}
} TasksCurrently the plugin only exposes a single task: updateOfflineRepository
Downloads dependency artifacts and stores them locally Plugin PropertiesThe offline-dependencies Plugin defines the following properties which may be configured within the
Handling Buildscript DependenciesThe are two issues when it comes to buildscript dependencies. Both stem from the fact that gradle applies the The first issue is that you can not use the default You can get around that limitation by setting the property yourself, e.g. by supplying it as a command line parameter:
Alternatively you can create an entry for this property in your project's The second issue is that gradle won't be able to resolve your buildscript dependencies when running the buildscript {
repositories {
maven {
url offlineRepositoryRoot
}
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenCentral()
jcenter()
}
dependencies {
classpath 'gradle.plugin.io.pry.gradle.offline_dependencies:gradle-offline-dependencies-plugin:0.5.0'
classpath 'some.other.buildscript:dependency:1.0.0'
}
}
offlineDependencies {
repositories {
// You'll have to add your buildscript repositories here too
maven {
url 'https://plugins.gradle.org/m2/'
}
mavenCentral()
jcenter()
}
includeSources = true
includeJavadocs = true
includePoms = true
includeIvyXmls = true
includeBuildscriptDependencies = true
} Just make sure that the Example build.gradleapply plugin: 'io.pry.gradle.offline_dependencies'
apply plugin: 'java'
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath "gradle.plugin.io.pry.gradle.offline_dependencies:gradle-offline-dependencies-plugin:0.5.0"
}
}
repositories {
maven {
url offlineRepositoryRoot
}
}
offlineDependencies {
repositories {
ivy {
url 'http://archiecobbs.github.io/ivyroundup/repo/modules/'
layout 'pattern', {
artifact '[organisation]/[module]/[revision]/packager.xml'
ivy '[organisation]/[module]/[revision]/ivy.xml'
}
}
mavenCentral()
}
includeSources = true
includeJavadocs = true
includePoms = true
includeIvyXmls = true
includeBuildscriptDependencies = false
configurations 'compile', 'debug'
buildScriptConfigurations 'classpath'
}
version = '1.0'
sourceCompatibility = 1.8
dependencies {
compile 'com.fasterxml.jackson.core:jackson-databind:2.7.1'
compile 'com.google.guava:guava:19.0'
} |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论