How to modify the source code of third lib in Intellij idea?

Answered

Hi,

We know that we can use maven to download source code and document in intellij idea. we can set breakpoint on the source code. I works fine and can be hit by the debbuger.

But I try to modify the source code and try to print out some information, it shows File is readonly.

As suggested, we can use the source code as a module in the project and use the snapshot version.

I go to the location of the source code file, I see sams-helper-1.0.14-sources.jar. I try to unzip it and try to add unziped folder to my project. But the structure of this folder is not the same as a normal module. 

Anyone can tell how I can add the source code as one module in my project? Thanks.

0
3 comments
Avatar
Yaroslav Bedrov

Hello,

You could select "File | New | Module from existing sources" and select your unzipped folder. IDE will create new module with sources.

0
Avatar
Permanently deleted user

Hi Yaroslav,

This is the unzipped folder structure.

 

This is my original project structure in idea.

 

And this is when I add the unzipped folder in my project. You see the imported module is a bit different in structure. It doesn't have a pom.xml file in the root folder. And it doesn't have src/main/java, all the folders. Is this OK? 

 

 
0
Avatar
Yaroslav Bedrov

> It doesn't have a pom.xml file in the root folder. And it doesn't have src/main/java, all the folders. Is this OK? 

It's OK, because it's not a Maven module, it's just sources. Still code completion and other feature will work fine as it's a plain java module.

0

Please sign in to leave a comment.