kobalt
kobalt copied to clipboard
Spring dependency resolution downloads file during build
I have the following demo build file in an otherwise pristine build obtained from:
~/kobalt-0.765/bin/kotlinw --init kotlin,idea
cat <<<EOF > kobalt/src/Build.kt
import com.beust.kobalt.*
import com.beust.kobalt.plugin.packaging.*
import com.beust.kobalt.plugin.application.*
val commonCompileDependencies = arrayOf(
"org.jetbrains.kotlin:kotlin-stdlib:1.0.1-2"
,"org.springframework.boot:spring-boot-starter-web:1.3.3.RELEASE")
val repos = repos("http://dist.gemstone.com/maven/release", "https://repo.spring.io/ext-release-local/")
val model = project() {
name = "myproject-model"
group = "com.mycompany.myproject"
artifactId = name
dependencies {
compile(*commonCompileDependencies)
}
}
EOF
./kobaltw --log 3 compile
Output is (I have all normal dependency already downloaded from previous projects):
───── myproject-model:compile Skipping nonexistent source directory ./src/main/java Skipping nonexistent source directory ./src/main/resources Calculating checksum of 1 files in ./src/main/kotlin INC - Incremental task myproject-model:compile output is out of date, running it Skipping nonexistent source directory ./src/main/java Skipping nonexistent source directory ./src/main/resources myproject-model: No resources to copy for MAIN Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/github/jnr/jnr-x86asm/maven-metadata.xml Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/github/jnr/jnr-x86asm/maven-metadata.xml Skipping nonexistent source directory ./src/main/java Skipping nonexistent source directory ./src/main/resources Skipping nonexistent source directory ./src/main/java Skipping nonexistent source directory ./src/main/resources Skipping nonexistent source directory ./src/main/java Skipping nonexistent source directory ./src/main/resources Kotlin 1.0.0 compiling 1 directory [...] Timings: myproject-model:compile: 37164 ms BUILD SUCCESSFUL (37 seconds)
In this case adding the spring dependency adds about 34s to the build time. This seems unusual.
Interesting. I see the following downloads being done on each build indeed:
Downloading: http://repo1.maven.org/maven2/com/github/jnr/jnr-x86asm/maven-metadata.xml
Downloading: https://jcenter.bintray.com/com/github/jnr/jnr-x86asm/maven-metadata.xml
Downloading: http://dist.gemstone.com/maven/release/com/github/jnr/jnr-x86asm/maven-metadata.xml
Downloading: https://repo.spring.io/ext-release-local/com/github/jnr/jnr-x86asm/maven-metadata.xml
Downloading: http://repository.jetbrains.com/all/com/github/jnr/jnr-x86asm/maven-metadata.xml
Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/github/jnr/jnr-x86asm/maven-metadata.xml
Downloaded: http://repo1.maven.org/maven2/com/github/jnr/jnr-x86asm/maven-metadata.xml (362 B at 0.5 KB/sec)
Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/github/jnr/jnr-x86asm/maven-metadata.xml
Downloaded: https://jcenter.bintray.com/com/github/jnr/jnr-x86asm/maven-metadata.xml (0 B at 0.0 KB/sec)
These are just pom.xml, no artifacts.
This doesn't seem to happen any more with the current release, can you update to the latest and try again?
I've just tried 0.786 and I still have the following:
───── myproject-model:compile
Skipping nonexistent source directory ./src/main/java
Skipping nonexistent source directory ./src/main/resources
INC - Incremental builds are turned off, running myproject-model:compile
Skipping nonexistent source directory ./src/main/java
Skipping nonexistent source directory ./src/main/resources
myproject-model: No resources to copy for MAIN
Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/github/jnr/jnr-x86asm/maven-metadata.xml
Downloading: https://oss.sonatype.org/content/repositories/snapshots/com/github/jnr/jnr-x86asm/maven-metadata.xml
Skipping nonexistent source directory ./src/main/java
Skipping nonexistent source directory ./src/main/resources
Ok will look again.