首页 > 编程语言 >idea 通过maven下载源码

idea 通过maven下载源码

时间:2024-02-15 17:22:33浏览次数:38  
标签:resolve sources idea used maven dependency 源码 dependencies

【问】如上图,IDEA 中点击 Download Source(下载源码)后,下载的源码存储到哪了?

 

【答】

先找到此源码所属 Jar 包在哪;
点击 Download Source(下载源码)后,会发现存储 Jar 包的位置多了一个后缀带有 -sources 的 Jar 包,这就是 IDEA 为我们下载的源码。
【问】如何找此源码所属 Jar 包在哪?

 

 

  

maven下载不到源码:Cannot download sources Sources not found for:

 

cmd命令行终端,然后进入到工程文件目录里,就是有pom文件的那个目录里,执行如下命令

mvn dependency:resolve -Dclassifier=sources
1
接下来他就会下载jar和源码了

完事之后,需要去choose Source,位置就和jar在一块 

原文链接:

参考链接:https://blog.csdn.net/qq_45634592/article/details/131845271

https://blog.csdn.net/maoyuanming0806/article/details/120079191

 

dependency:resolve

Resolve is intended to be used from the command line like: mvn dependency:resolve -Dsilent=true

This goal simply tells maven to resolve all test scope (includes compile) dependencies and then displays the resolved versions. This is intended to help ensure all dependencies are downloaded to the local repository. This is useful when troubleshooting or during intermittent remote repository failures when repeatedly building multiproject modules is undersirable and the build is failing on dependency resolution. It can also be used to quickly determine how versions are being resolved.

Artifacts can also be resolved by specifying the classifer and optionally type. Type is only used with the classifier and defaults to java-sources. When the classifier is set, the list of dependencies is used as the base to resolve artifacts with the classifer and type. For example: mvn dependency:resolve -Dclassifer=test-jar will try to find the test-jar for all dependencies resolve them to the local repository.

dependency:sources

Sources is intended to be used from the command line like: mvn dependency:sources -Dsilent=true

This is the same as the resolve goal except it includes the source attachments if they exist. This is useful when you want to download source attachments to your local repository.

You can also define the markersDirectory either in the pom or settings to be a common location for all projects. This allows the system to resolve sources faster for dependencies that don't have the sources published. The plugin will store a marker file to describe if the sources were resolved or not. By placing them in a common location, multiple attempts to resolve non-existent sources will be avoided.

 

标签:resolve,sources,idea,used,maven,dependency,源码,dependencies
From: https://www.cnblogs.com/youxin/p/18016374

相关文章

  • PyZelda 源码解析(全)
    .\Zelda-with-Python\Code\Debug.py#导入pygame和os模块importpygameimportos#设置当前工作目录为项目所在的目录,用于导入文件(特别是图片)os.chdir(os.path.dirname(os.path.abspath(__file__)))#初始化pygamepygame.init()#创建字体对象,用于在屏幕上显示调试信......
  • Idea--解决character ‘@‘ that cannot start any token. (Do not use @ for indenta
    原文网址:​​Idea--解决character‘@‘thatcannotstartanytoken.(Donotuse@forindentation_IT利刃出鞘的博客-CSDN博客​​简介本文介绍如何解决character‘@‘thatcannotstartanytoken.(Donotuse@forindentation这个问题。分享Java技术星球(自学精灵),网......
  • Ubuntu 中通过源码安装 Python3.x 环境
    最近在个人前后端分离项目时候,后端接口程序fastapi,在部署的时候,需要Pyhton3.8以上的环境,但ubuntu默认的是2.7于是想通过源码安装的方式进行环境搭建.下载官网下载二进制源码安装包:https://www.python.org/downloads/source/wegthttps://www.python.org/ftp/......
  • 18.Jenkins的maven插件配置
    Maven的集成在Jenkins上构建Java项目时需要使用Maven来进行构建打包在执行job的机器上安装好maven下载maven程序压缩包解压maven压缩包配置环境变量下载maven插件进入菜单Dashboard->系统管理(ManageJenkins)->插件管理(ManagePlugins)在可选......
  • IDEA破解
    1.打开已经安装好的IDEA,我们选择30天免费试用,先进去再说:   2.进入 IDEA中,先随便建个Java工程,然后将网盘中最新的IDEA无限重置30天试用期补丁ide-eval-resetter-2.1.6.zip拖入IDEA界面中,如下图所示   3.重启IDEA   4.点击Eval Rese......
  • Maven执行Reimport命令报错:See logs for details
     参考:https://www.cnblogs.com/huanshilang/p/11557642.html参考2:https://blog.csdn.net/h2677lucy/article/details/120642945......
  • 一个好用的IDEA插件RestfulTool: 根据url快速定位方法
    前言我们平时使用IDEA进行web开发,URL通常会分开写在Controller的类和方法上,用一个完整的URL很难定位到具体的方法。IDEA的插件RestfulTool,提供了这样的能力,根据完整URL直接定位方法。使用下载插件有很多插件都有此功能,这里我们选择RestfulTool插件。简单使用......
  • idea修改jetty代码后不用重启项目
    确保是Debug模式 注意:上面还有个是:updateresources,这个配置应该是只会更新JS和JSP这些,而不会重新编译class文件,如果选择updateclassesandresources会重新编译java文件和JSP,js,相当于热部署。(这个有时候会报错不能删除jar包,多切换几次上面的更新的......
  • maven--插件的管理(pluginManagement)
     原文网址:​​maven--插件的管理(pluginManagement)_IT利刃出鞘的博客-CSDN博客​​简介说明本文介绍maven如何使用pluginManagement来管理插件(build标签中的plugins标签)。概述Maven使用 dependencyManagement对依赖进行管理,见:​​这里​​,与之类似地,Maven中还提供了一个......
  • IDEA下载其他版本及快速破解
    其他版本的下载IDEA下载-https://www.jetbrains.com/zh-cn/idea/download/other.htmljetbrains公司其他产品也是类似的路径,如Pycharm下载-https://www.jetbrains.com/zh-cn/pycharm/download/other.html,将路径中的idea换成pycharm。安装及破解安装就是正常安装,一直下一步就行,......