Can I automatically update an Intellij project to use the latest snapshot using gradle?

Is there a way to get IntelliJ to automatically update the latest dependency snapshot using gradle?

I currently have two projects: A and B. A is the library that B. uses. I develop them at the same time from scratch.

I have a Jenkins build that checks the code from the development branch, runs the gradle build script construct, and then publishes the artifact in my snapshot archiver.

My build.gradle configured to use integration.latest from my snapshot repository, but IntelliJ will not automatically make changes. I have to go to jetgradle, click update, and then import a new snapshot, and then delete the previous snapshot.

Is there an easier way?

+4
source share
2 answers

So, it seems that there is no way to automatically display the last shot. I wanted to have well-designed library projects, but still actively develop them, at the same time I worked on projects that depended on them.

In the end, I created the main project with my own build.gradle. Then I added git submodules for my library projects.

This allows me to have separate library projects that I can reuse, but also a quick development cycle, since I don’t have to wait for artifacts to be transferred to my artificial server.

My Jenkins build is still pulling artifacts from my artificial server, though.

+1
source

If you update the local code in Project A and want them reflected in project B with dependency A, you must run gradle install in project A. (installation is available on the IntelliJ taskbar). The installation will update the jar to the local maven repository and update IntelliJ with the latest code.

0
source

Source: https://habr.com/ru/post/1438987/


All Articles