akhikhl / gretty

Advanced gradle plugin for running web-apps on jetty and tomcat.
MIT License
656 stars 171 forks source link

Gretty is NOT loading springboot libs of another gradle subproject #410

Open noiter opened 6 years ago

noiter commented 6 years ago

Description (How to reproduce the issue): Given I on working on a gradle multiproject, with structure like below,

-- root
  |- service
    |- src
    |- build.gradle
  |- webapp
    |- src
    |- build.gradle
  |- build.gradle

Assume my webapp is something like gretty taglib example. I configure gretty server inside the build.gradle under webapp project, then I put below code inside build.gradle under service project,

dependencies {
  ...
  compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: '1.5.9.RELEASE'
  ...
}

Now I run ./gradlew clean appRun. When I open browser I won't see any libs that being dependent by service project on web page.


A project-specific solution that works to me:

I changed

dependencies {
  ...
  compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: '1.5.9.RELEASE'
  ...
}

to

dependencies {
  ...
  compileOnly group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: '1.5.9.RELEASE'
  ...
}

I believe this issue is a bug inside Gretty, so I wonder if you can have a look.

Much appreciated. :)

arisjramos commented 6 years ago

I Have a similar problem with JPA annotated entity classses comming from another gradle subproject, the problem seems to occur with inplace webapp, it works with appRunWar task.

javabrett commented 6 years ago

Can anyone supply a minimal project that reproduces this problem? Thanks.

noiter commented 5 years ago

Go to https://github.com/noiter/gradle-multiproject-gretty as an example for reproducing the issue.