我想使用来自github的sql解析库:
该页面显示,Maven
需要以下pom.xml
代码才能导入。
<repositories>
<repository>
<id>jsqlparser-snapshots</id>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>1.1</version>
</dependency>
但是,我正在使用gradle。因此,上述dependency
中的pom.xml
部分会或多或少地转变为gradle.build
:
dependencies {
compile("com.github.jsqlparser:jsqlparser:1.1")
}
但我不知道如何转换repository
代码的内容,特别是snapshot
和url
。
答案 0 :(得分:1)
Do you really want to use snapshot builds, which is latest development version that might break stuff inadvertently? If not, you read the instructions wrongly. You can simply use mavenCentral()
or jcenter()
as Gradle repository for your build to get the latest released version of that library.
If you really want the snapshot versions, you use maven { url 'https://oss.sonatype.org/content/groups/public' }
and use x.y-SNAPSHOT
in the version, or something like x.+
for the latest available version, including snapshot versions. You don't need to specially enable snapshot version usage with Gradle.