简体   繁体   中英

IntelliJ can't associate javadoc and sources for dependencies

I have noticed that my IntelliJ doesn't properly show javadoc/sources. I have downloaded them thru right click -> maven -> download sources and documentation. When I go to the directory where its supposed to be located, I find everything that I need:

xxx-javadoc.jar.lastUpdated
xxx.sources.jar.lastUpdated

The issue seems to be.lastUpdated part. When I look at my project dependencies I can see clearly that intelliJ looks for xxx-javadoc.jar instead of

xxx-javadoc.jar.lastUpdated

How can I make sure that IntelliJ properly downloads and names javadoc/sources properly? I don't want to manually rename everything and then manually set javadoc/sources through IntelliJ interface.

I think this issue happened when I interrupted the download of sources/documentation

The .lastUpdated files are not the jar fails themselves, but a mechanism that Maven uses to track when it last updated a file. Ie, the file you should load in IntelliJ is the jar file, not the .lastUpdated file.

If an interrupted/corrupted update is causing issues, remove that fail along with its .lastUpdated file and download (synchronize in IntelliJ) it again.

Ok, I have searched around and problem was probably caused by interuption of download sources/documentation process. Using bat file:

@echo off
setlocal EnableDelayedExpansion
set last=?
 
for /f %%I in ('dir /s /b /o:n /a-d "*.lastUpdated"') do (
  if !last! NEQ %%~dpI ( 
    set last=%%~dpI
    echo !last!
    rd /s /q !last!
  )
)
goto end
 
:end

I managed to remove all the necessary files. Now downloading again. If this happens to you, use the above bat script if you are on windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM