a.moussa
a.moussa

Reputation: 3287

Cannot download sources from jar in intellij with maven

I want to debug my maven project. I add a dependency Test that I have developped like this:

<dependencies>
      <dependency>
        <groupId>com.company.group</groupId>
        <artifactId>test</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
</dependencies>

when I debug my program and I enter into Test dependent method I see /* compiled code */. If I click on attach source It does nothing and if I click on download source, I get a pop up message saying: Cannot download sources, Sources not found for: com.mycompany.group:test:0.0.1-SNAPSHOT

I also tried to execute :

mvn dependency:sources

But when I try to enter my dependent method I just see /* compiled code */ Do you have any idea?

Upvotes: 0

Views: 4448

Answers (1)

Michael Peacock
Michael Peacock

Reputation: 2104

It's not uncommon for sources to be unavailable for custom jars, since developers would have to explicitly create a source jar using the Maven Source Plugin and install this jar in a remote repository. There's a Maven cookbook page for this as well.

If you have no way of adding sources for your dependencies, then I think your best bet would be to use a decompiler.

Upvotes: 3

Related Questions