ysb33r / ivypot-gradle-plugin

Ivypot is a Gradle plugin to help managing a local off-line repository for builds in restricted environments
Apache License 2.0
45 stars 14 forks source link

Cannot resolve versions with Spring Boot Gradle Plugin #31

Open guardiande opened 6 years ago

guardiande commented 6 years ago

Hi,

There is a Spring Boot Gradle Plugin to manage Spring dependency versions: https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/

Unfortunately it does not work with IvyPot:

$ ./gradlew syncRemoteRepositories

> Task :syncRemoteRepositories FAILED
[syncRemoteRepositoriesConfigure] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[syncRemoteRepositoriesConfigure] :: loading settings :: file = /Users/blockchain/Development/digits-dataservice/Eclipse/ivypot-test/build/tmp/syncRemoteRepositories/ivysettings.xml
[syncRemoteRepositoriesResolve] ivy.instance reference an ivy:settings defined in an other classloader.  An new default one will be used in this project.
[syncRemoteRepositoriesResolve] :: problems summary ::
[syncRemoteRepositoriesResolve] :::: WARNINGS
[syncRemoteRepositoriesResolve]                 module not found: org.springframework.boot#spring-boot-starter-web;null
[syncRemoteRepositoriesResolve]         ==== MavenRepo: tried
[syncRemoteRepositoriesResolve]           http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web/null/spring-boot-starter-web-null.pom
[syncRemoteRepositoriesResolve]           -- artifact org.springframework.boot#spring-boot-starter-web;null!spring-boot-starter-web.jar:
[syncRemoteRepositoriesResolve]           http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web/null/spring-boot-starter-web-null.jar
[syncRemoteRepositoriesResolve]                 ::::::::::::::::::::::::::::::::::::::::::::::
[syncRemoteRepositoriesResolve]                 ::          UNRESOLVED DEPENDENCIES         ::
[syncRemoteRepositoriesResolve]                 ::::::::::::::::::::::::::::::::::::::::::::::
[syncRemoteRepositoriesResolve]                 :: org.springframework.boot#spring-boot-starter-web;null: not found
[syncRemoteRepositoriesResolve]                 ::::::::::::::::::::::::::::::::::::::::::::::

Here's the build.gradle:

buildscript {
    ext {
        springBootVersion = '2.0.1.RELEASE'
    }
    repositories {
        mavenLocal()
        mavenCentral()
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
    }
}

plugins {
  id 'org.ysb33r.ivypot' version '0.7'
}

apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.digits'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    compile "org.springframework.boot:spring-boot-starter-web" // :2.0.1.RELEASE"
}

syncRemoteRepositories {
  repoRoot "${buildDir}/repo"

  repositories {
    mavenCentral()
  }

  addAllProjects()
}

When I change the dependencies to

dependencies {
    compile "org.springframework.boot:spring-boot-starter-web:2.0.1.RELEASE"
}

it works.

guardiande commented 6 years ago

Maybe related to #21?

ysb33r commented 6 years ago

Maybe there is an issue with how Ivy resolve these kind of dependencies

WIll check when I get a chance, but (unfortunately) only be in about 3 weeks time.

ysb33r commented 5 years ago

I think the issue is related to the way that the spring-boot plugin delays evaluation of the dependencies, which results in null versions being reported to Ivy.

This is going to be a tricky fix and I'll need to look in to the SpringBoot's plugin source code first.

ysb33r commented 4 years ago

*PLEASE NOTE: The repo has moved here https://gitlab.com/ysb33rOrg/ivypot-gradle-plugin