Skip to content

Support for compileOnly dependencies #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snicoll opened this issue Jul 20, 2015 · 4 comments
Closed

Support for compileOnly dependencies #128

snicoll opened this issue Jul 20, 2015 · 4 comments
Assignees

Comments

@snicoll
Copy link
Contributor

snicoll commented Jul 20, 2015

The new devtools could use to have an <optional>true</optional> entry as it shouldn't ship with the actual app by default.

Provided scope is not managed properly in Intellij IDEA so that's not a great candidate unfortunately (and the semantic would be wrong anyway).

@dsyer
Copy link
Contributor

dsyer commented Dec 26, 2015

I guess that means we have to have an answer to the question "what does 'optional' mean for a gradle dependency?". Refs: https://issues.gradle.org/browse/GRADLE-1749, https://github.com/nebula-plugins/gradle-extra-configurations-plugin.

@snicoll
Copy link
Contributor Author

snicoll commented Dec 26, 2015

We already have a plugin of our own that does that and we use it in the Spring Framework build so all it takes really is integrating the plugin in the gradle build when an optional and/or provided dependency is added to the project

The only thing I don't know for sure is whether the Spring Boot repackage goal is smart enough to react to that.

@snicoll
Copy link
Contributor Author

snicoll commented Nov 3, 2016

OK so I've started to work on this. We have 3 cases at this point:

  • Lombok (annotation processor)
  • The Spring Boot configuration processor (ditto)
  • Devtools

We can deal with all these with "optional" in Maven. And ignore Gradle but the first two could be handled with the new compileOnly thing in Gradle. I am not sure that devtools will work (and even if it did, it's a bit weird).

@wilkinsona any insight?

@wilkinsona
Copy link
Contributor

compileOnly is perfect for annotation processors. It won't work for DevTools as compileOnly dependencies aren't on the class path at runtime.

@snicoll snicoll changed the title Support for optional dependencies Support for compileOnly dependencies Nov 4, 2016
@snicoll snicoll closed this as completed in 079f46f Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants