How to modify source code for external libraries

Hi,
I am using the spark machine learning libraries as an external library within Intellij IDEA, and I am going through the source code but I cannot modify the source code.
It is read-only. How can I make changes to the source code of these external libraries? please help!

Thanks

7 comments
Comment actions Permalink

External libraries should be configured as the module content roots or source roots in order to be modifiable.

0
Comment actions Permalink

Could you please list the steps of doing that?

0
Comment actions Permalink

I have a maven project. I have the attached screenshot that shows the project window (for my project named kmeans222). Under the external libraries, there is the
org.apache.spark:spark-mllib_2.10:1.3.1

When I debug my program, I can see the source code for the mllib library but I cannot edit it.

What steps should I exactly follow from  https://www.jetbrains.com/idea/help/configuring-content-roots.html   in order to be able to edit the source code for this mllib library? I have also attached my project structure's modules,
which has the whole project kmeans222 added as a content root. I'd very much appreciate if you could please provide me step by step detailed instructions. Thank you very much.



Attachment(s):
Screen Shot 2015-07-21 at 4.08.46 PM.png
Screen Shot 2015-07-21 at 3.59.10 PM.png
0
Comment actions Permalink

For the Maven based projects there is no easy way to modify external library sources in IDEA.

Normally you'd have to modify your pom.xml. Remove this library dependency from pom.xml and copy the sources of the library to your own project.
Or you need to checkout this library source project into a separate module and configure pom.xml to use snapshot dependency on that module.

It's really not IDE specific, find a way to organize your project so that this library source is built as a part of this project instead of using the jar dependency from the repository. If you don't know how to do it, please ask in some Maven community or at stackoverflow.com.

0
Comment actions Permalink

What about for PHPStorm?  If I add it to the Directories then it expects an HTTP mapping!

0
Comment actions Permalink

There's no HTTP mapping at File | Settings | Directories.

Please clarify what do you mean.

0

Please sign in to leave a comment.