Download sources through nexus

Answered

When opening a decompiled class file the editor displays options for downloading or choosing sources. When selecting the download option, IntelliJ tries to find the sources at search.maven.org and oss.sonatype.org, but I want it to search our internal nexus repository. How can I add our own repository?

I have tried to add our nexus service url in Settings > Build, Execution, Deployment > Build Tools > Maven, but it does not work as expected.

4
8 comments
Avatar
Permanently deleted user

No, it does not seem like the same issue

Is Settings > Build, Execution, Deployment > Build Tools > Maven the correct place to add our nexus url? If so, I tried to remove all other repositories in the list, but it still searches search.maven.org and oss.sonatype.org.

 

0
Avatar
Permanently deleted user

Looks like the repo URLs hardcoded somewhere... For example, I have non-maven project (Ant + Ivy). When I open some compiled class from imported library Idea also proposes to download the sources. And it works fine if the source code of a library is available either in search.maven.org or oss.sonatype.org. But if the library is our own internal library, then obviously the source code won't be found on these repos. I'm also wondering if there is an option to specify our own internal Maven-compatible repos for finding source code using this feature?

0

For Maven projects repositories are specified in pom.xml. If you are using IvyIDEA plug-in, it may use some other configuration for that.

0
Avatar
Permanently deleted user

Hi Serge,

Thank you for your advise. The projects which I'm working at, are not Maven projects. Also, IvyIDEA plugin is not suitable for me. I use my own Ant script for resolving the projects dependencies using Ivy. The connection between my workstation and customer's Nexus repo is too slow, so I didn't include resolving of source files in the script. But sometimes, I need particular source code for some library.

I've taken a brief look at Intellij source code for Community edition (as I understand, the feature for source searching is available for both editions, Community and Ultimate). I found the searcher classes like:

https://github.com/JetBrains/intellij-community/blob/master/java/java-impl/src/com/intellij/jarFinder/MavenCentralSourceSearcher.java

https://github.com/JetBrains/intellij-community/blob/master/java/java-impl/src/com/intellij/jarFinder/SonatypeSourceSearcher.java

Perhaps, it is possible to implement some Source Searcher for custom repos depends on its type, e.g. for Nexus, Artifactory. I'm not sure that all of them provide an API for artifacts searching. But maybe such Idea is planned by JetBrains? :)

1
Avatar
Permanently deleted user

Ok, thank you

0

Please sign in to leave a comment.