Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Cannot resolve versions with Spring Boot Gradle Plugin #31

Open
guardiande opened this issue May 15, 2018 · 4 comments
Open

Cannot resolve versions with Spring Boot Gradle Plugin #31

guardiande opened this issue May 15, 2018 · 4 comments

Comments

@guardiande
Copy link

guardiande commented May 15, 2018

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
Copy link
Author

Maybe related to #21?

@ysb33r
Copy link
Owner

ysb33r commented May 16, 2018

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
Copy link
Owner

ysb33r commented May 8, 2019

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
Copy link
Owner

ysb33r commented Apr 23, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants