Can not download sources with Intellij Idea community 12.1.4 and maven 3.0.5

JavaMavenIntellij Idea

Java Problem Overview


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.

Java Solutions


Solution 1 - Java

In Intellij 2017.x, 2016.x, 15.x, 14.x the given solution does not work as the option is removed.

The problem can be solved by changing JDK for Importer to a latest JDK instead of User Internal JRE which was 1.6.0 by default on Mac

The setting JDK For Importer can be found in: > Preferences -> Build, Execution,Deployment -> Build Tools -> Maven -> Importing

Solution 2 - Java

Running IDEA version 12.1.6 and I have the same issue.

When I uncheck the following option it does work:

Settings > Maven > Importing > Use Maven3 to import project

Solution 3 - Java

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.

Solution 4 - Java

"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

Solution 5 - Java

Had the same issue with IntelliJ 2016.2.4. As user526177 posted udating the Maven version fixes it but for my needs switching to the bundled Maven 2 was just fine and fixed the issue.

Screenshot (can't embed yet due to rank)

Solution 6 - Java

I use IDEA 2017.1.3, I just change the Maven home directory option(Preferences -> Build, Execution,Deployment -> Build Tools -> Maven -> Maven home directory) of default Maven 3 to Maven 2, I believe it's the same solution for newer version of IDEA just like the selected answer. And it works for me.

Solution 7 - Java

I had this issue, and sources weren't being downloaded since I needed credentials from my project's specific settings.xml.

To fix (Intellij 2018.1.2):

File -> Settings -> Build, Execution, Deployment -> Maven

and provide the appropriate settings.xml in the 'User settings file' section

Solution 8 - Java

I solve this by use jdk 1.8 in MAVEN -> RUNNER -> JRE .my idea version is 2016.2

Solution 9 - Java

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>

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCherryView Question on Stackoverflow
Solution 1 - JavaChakraView Answer on Stackoverflow
Solution 2 - JavaingaraView Answer on Stackoverflow
Solution 3 - Javaxtermi2View Answer on Stackoverflow
Solution 4 - Javakj6682View Answer on Stackoverflow
Solution 5 - JavaKwyjiboView Answer on Stackoverflow
Solution 6 - JavaguamiansangView Answer on Stackoverflow
Solution 7 - JavaBrian AgnewView Answer on Stackoverflow
Solution 8 - JavamarkView Answer on Stackoverflow
Solution 9 - Javalight77View Answer on Stackoverflow