0

I tried to find a lot of answers but could not find any which works as expected. So posting here. It can be a possible duplicate but unable to find any right answers.

Let's consider project A as my maven project and Project B as EclipseLink JAXB/Moxy library code. I am using Intellij IDE for my application.

I have a (My JAXB Project) Project A which is using the 3rd party library Eclipselink Moxy (Project B) and I believe Project B has some issue due to which Project A is not providing the output as expected. I would like to debug Project B to find the issue.

So I have downloaded the source code from Github for the Project B. Now I would like to include this Project B code from this local as my maven dependency in my Project A.

I know I can create a JAR for Project B using the mvn clean install -Dskiptests and include that JAR in my Project A but I would like to make few changes during the debug. As of now, if I make any changes to Project B then every time I need to create the JAR. The library files are very huge and it has many modules and submodules due to which it takes a lot of time (around 5-10 mins). Also, I am unable to edit the class file within JAR so need to edit the class file of Project B again to create JAR, and again add it to the project A. This is too much of a task and waiting time.

Hence, I want to know how can I add the Project B directly from local so that I do not have to create JAR every time and make changes to project B and see the changes updated directly when I run the Project A.

I tried a lot of things since yesterday but nothing seems to work till now so thought of asking the same.

In short, all I want to do is: Add the dependency from local project so when I click on the source for my code I can open the class file from my local project because opening the class file from JAR does not provide me an option to edit.

1
  • 1
    In Eclipse you can do that. It is called "Workspace Resolution" and part of the m2e plugin. Commented Jun 9, 2021 at 7:06

2 Answers 2

0
  • Change version in main pom.xml of Project B to one which is not there in you repo.
  • install Project B using install -U command.
  • Use the custom version of Project B in Project A. You can also put break point now in workspace of Project A to debug.
Sign up to request clarification or add additional context in comments.

Comments

0

You can make a multi module project in Intellij.

First create a maven project for project A in Intellij, then you can add Project B as an additional module in the same project.

This way you would be able to debug and hot replace the code of Project B as well.

Help related to adding a module can be found here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.