mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -07:00
file:// no longer seen as valid maven coordinates.
This commit is contained in:
parent
096b2c20a4
commit
ddb4b3dbd8
1 changed files with 8 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
package com.beust.kobalt.maven
|
package com.beust.kobalt.maven
|
||||||
|
|
||||||
import com.beust.kobalt.api.Kobalt
|
import com.beust.kobalt.api.*
|
||||||
import org.eclipse.aether.artifact.DefaultArtifact
|
import org.eclipse.aether.artifact.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encapsulate a Maven id captured in one string, as used by Gradle or Ivy, e.g. "org.testng:testng:6.9.9".
|
* Encapsulate a Maven id captured in one string, as used by Gradle or Ivy, e.g. "org.testng:testng:6.9.9".
|
||||||
|
@ -17,9 +17,13 @@ class MavenId private constructor(val groupId: String, val artifactId: String, v
|
||||||
val classifier: String?, val version: String?) {
|
val classifier: String?, val version: String?) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun isMavenId(id: String) = with(id.split(':')) {
|
fun isMavenId(id: String) = if (id.startsWith("file://")) {
|
||||||
|
false
|
||||||
|
} else {
|
||||||
|
with(id.split(':')) {
|
||||||
size >= 3 && size <= 5
|
size >= 3 && size <= 5
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun isRangedVersion(s: String): Boolean {
|
fun isRangedVersion(s: String): Boolean {
|
||||||
return s.first() in listOf('[', '(') && s.last() in listOf(']', ')')
|
return s.first() in listOf('[', '(') && s.last() in listOf(']', ')')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue