Can not download sources with Intellij Idea commun

2019-02-04 05:27发布

I click "download sources and documentation" in Intellij Idea Community Edition 12.1.4 and get error that sources can not be downloaded. But when I try:

mvn dependency:sources

All sources are downloaded.

What is the problem?

P.S. I have checked that Idea use the same maven that use in console. There are not any "off line" mode buttons triggered in Idea.

9条回答
神经病院院长
2楼-- · 2019-02-04 06:14

I had the same issue with IntelliJ IDEA 2016.1.3 and Maven 3.2.1. No solution mentioned here was working. In my case a newer Maven version fixed the issue. With Maven 3.3.9 IDEA can now download the sources.

查看更多
干净又极端
3楼-- · 2019-02-04 06:14

"I had the same issue with IntelliJ IDEA 2016.1.3 and Maven 3.2.1. No solution mentioned here was working. In my case a newer Maven version fixed the issue. With Maven 3.3.9 IDEA can now download the sources."

anything's already in the former answers...

  • download sources in your repo mvn dependency:sources
  • F4 on the class you want to check the sources out
  • locate the source jar in your local repository

maybe it is not a full IDE solution, but hope it solves your issue

查看更多
Root(大扎)
4楼-- · 2019-02-04 06:14

I changed the java version in pom.xml to match my jdk's version and it worked for me.

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

     <!--earlier this was 1.8-->
    <java.version>10</java.version>

</properties>
查看更多
登录 后发表回答