JetBrains debugger does not load class from developer environmet but from m2 folder
Hello everyone, I am using IntelliJ Idea. I have installed the latest version. I have a complex J2EE development environment. There is a pom.xml file that groups around twenty subprojects, and each subproject consists of several other projects. Additionally, there are common parts present in the .m2 repository as JAR files. During debugging, the development environment uses the JAR files from the .m2 folder instead of utilizing the .class files. 🚀👩💻
The applications are deployed into a IBM Liberty Server.
I tried running mvn clean compile install, stopping and restarting the Liberty web server, but IntelliJ still detects the class from the .m2 repository instead of the one from the development environment. 🤔🚀
Can anyone help me?
best regards.
Fede.
Please sign in to leave a comment.
Hi Fede,
Please provide screenshots of the following:
File | Settings | Build, Execution, Deployment | Build Tools | MavendialogFile | Settings | Build, Execution, Deployment | Build Tools | Maven | RunnerdialogDoes it make a difference if you:
I apologize, but company guidelines prevent me from sharing information related to the development environment.
I have set the ‘Unpack nested archives’ flag for all exploded artifacts. I ran
mvn clean compile installfrom IntelliJ.”After this, I have set ‘Enable’ the option to ‘Delegate IDE build/run actions to Maven’ , and I ran
mvn clean compile installfrom IntelliJ.Both the build endend whithout errors.
Ii have started the server, but nothing is changed. When I'm going to debug I see:
> During debugging, the development environment uses the JAR files from the .m2 folder instead of utilizing the .class files.
Assuming your problem has to do with being displayed the very lasted version of your source code while debugging.
IntelliJ will only show the very lasted version of a source code IF and ONLY IF the class is part of the CURRENT project.
For example, if you have a PROJECT_A having a dependency to a jar produced by PROJECT_B, then while debugging PROJECT_A, IntelliJ should display the very latest source code from PROJECT_A when stepping through classes from PROJECT_A, but when stepping through classes from PROJECT_B, IntelliJ will display source code coming from the source.jar of the .m2/repository.
To have the latest source code from both PROJECT_A AND PROJECT_B then both projects must be part of the same IntelliJ project. To do that, create a new empty IntelliJ project and import both projects as modules in the project structure setting > Modules.
In you case you can just create a project by importing the root pom you are talking about. (i.e. the pom.xml file that groups around twenty subprojects)
> The applications are deployed into a IBM Liberty Server
If I understood your problem well, then this part is irrelevant.
Hope this help.
Another option to try is to open your Project as usual and then linking the Projects it depends on using “+” button from the Maven Tool Window.