Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij + springboot + maven + spring-loaded

I have an issue where debugging stops working in Intellij, when applying Spring-loaded as a dependency to the maven plugin.

Situation 1 (working):

Using a autogenerated spring-boot maven (pom.xml) file with a declared "Spring-boot-maven-plugin" I can debug my my app using the debug-maven command in intellij. The pom file looks like this:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Situation 2 (not working):

Following the guide lines here: spring-boot-hot-swapping one should add a dependency for spring-loaded, to make use of spring-loaded. The pom file now looks like:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <dependencies>
                <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>springloaded</artifactId>
                    <version>1.2.3.RELEASE</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

Debugging the same run-configuration as before does not work. The break-points simply never turns into a "checkmark" and the code never suspends. Code is now hotswapping as one would expect... If I remove the plugin-dependency again, debugging starts working again...

Please help me make situation two work!

IntelliJ 14.1.3 Ultimate, Java 7, Spring boot 1.2.4, Spring loaded 1.2.3

like image 917
Hoof Avatar asked Jun 23 '15 18:06

Hoof


People also ask

Why Spring is not showing in IntelliJ?

Enable Spring support in IntelliJ IDEA This functionality is not available in IntelliJ IDEA Community Edition and IntelliJ IDEA Edu. Press Ctrl+Alt+S to open the IDE settings and select Plugins. Open the Installed tab, search for Spring and make sure that the checkboxes next to all relevant plugins are selected.


2 Answers

Since it seems there is no one with an answer to this (nor in IntelliJ forums) i've created an issue: https://youtrack.jetbrains.com/issue/IDEA-142078

like image 81
Hoof Avatar answered Sep 28 '22 05:09

Hoof


Did you try with spring-devtools (since 1.2.3) ? Use this dependency :

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
</dependency>

There is already a ticket here, it seams the same issue.

like image 43
Nelson G. Avatar answered Sep 28 '22 06:09

Nelson G.