【依赖dependency / 插件Plugin】 not found?可以看看这思路

本文讨论Maven中依赖查找问题,涉及本地仓库、版本号和资源坐标,提供了解决路径。

Unresolved dependency: XXXXX

Could not find artifact XXXX

Plugin 'org.apache.maven.plugins:maven-compiler-plugin:' not found 

这些报错其实本质上来讲就是在本地仓库中找不到所需要的依赖 / 插件,那么这篇文章就从地址锁定的角度来看一下引入依赖 or plugin的注意点,希望能给大家解决八阿哥多一个不一样的思路~~


业务需求:将一个工具项目打包为Jar给另一模块使用

依赖找不到

工具项目打包为Jar

当你运行Maven项目并执行 install 命令时,生成的JAR包会被安装到本地Maven仓库中,同时也会被复制到你的项目的target目录中。

锁定该Jar包位置

下载好的Jar包会被安装在 本地仓库地址 + 资源坐标信息

资源的坐标信息:项目的唯一标识符项目的名称或者模块的名称 项目的版本号

这些元素通常位于 pom.xml 文件的顶层(<project> 元素下),例如:

<project>
  <groupId>cn.bugstack.middleware</groupId>
  <artifactId>db-router-spring-boot-starter</artifactId>
  <version>1.0.2-SNAPSHOT</version>
  ...
</project>

假设你的本地仓库是默认地址(.m2/repository)的情况下,该Jar包将被下载到:

C:/XXX/.m2\repository\cn\bugstack\middleware\db-router-spring-boot-starter

所以一开始未能找到该依赖的原因也很明显啦,就是因为版本号<version>不正确导致的,通过上图可以知道,我们可以运用的版本有1.0.0和1.0.2-SNAPSHOT,所以改回来就好啦

当前项目引用该正确Jar包位置

其实这里写的内容和工具项目<project>标签中的项目坐标信息一模一样

然后一刷新就能用啦!但是前提是两个项目的本地仓库都设置为同一个位置才行 


插件找不到

其实这里如果大家理解了上面的地址定位的方式就能发现问题了,那就是 资源坐标信息 没有完善,少了个<version>有木有发现,但是你不能凭空写吧?所以老老实实去找一下自己的本地仓库吧~

挑一个版本补充好 资源坐标信息 就OK啦

搞定!希望本文对大家有帮助^_^~ 

gapinyc@DESKTOP-9QS7RL5:~/superset-prod/superset-5.0.0/superset-frontend$ npm install npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated lodash.isequal@3.0.4: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. npm warn deprecated viewport-mercator-project@7.0.4: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm warn deprecated lodash.get@4.4.2: This package is deprecated. Use the optional chaining (?.) operator instead. npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead. npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead. npm warn deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142 npm warn deprecated rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm warn deprecated har-validator@5.1.5: this library is no longer supported npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead npm warn deprecated lodash.isequal@4.5.0: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated domexception@1.0.1: Use your platform's native DOMException instead npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm warn deprecated left-pad@1.3.0: use String.prototype.padStart() npm warn deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin. npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead npm warn deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added npm warn deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info. npm warn deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm warn deprecated @babel/polyfill@7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information. npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead npm warn deprecated topojson@1.6.27: Use topojson-client, topojson-server or topojson-simplify directly. npm warn deprecated puppeteer@22.15.0: < 24.15.0 is no longer supported npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options. added 3932 packages, and removed 1 package in 3m 698 packages are looking for funding run `npm fund` for details gapinyc@DESKTOP-9QS7RL5:~/superset-prod/superset-5.0.0/superset-frontend$ npm run build > superset@5.0.0 build > cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV="${BABEL_ENV:=production}" webpack --color --mode production [Superset Plugin] Use symlink source for @superset-ui/chart-controls @ ./packages/superset-ui-chart-controls [Superset Plugin] Use symlink source for @superset-ui/core @ ./packages/superset-ui-core [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-calendar @ ./plugins/legacy-plugin-chart-calendar [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-chord @ ./plugins/legacy-plugin-chart-chord [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-country-map @ ./plugins/legacy-plugin-chart-country-map [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-horizon @ ./plugins/legacy-plugin-chart-horizon [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-map-box @ ./plugins/legacy-plugin-chart-map-box [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-paired-t-test @ ./plugins/legacy-plugin-chart-paired-t-test [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-parallel-coordinates @ ./plugins/legacy-plugin-chart-parallel-coordinates [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-partition @ ./plugins/legacy-plugin-chart-partition [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-rose @ ./plugins/legacy-plugin-chart-rose [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-world-map @ ./plugins/legacy-plugin-chart-world-map [Superset Plugin] Use symlink source for @superset-ui/legacy-preset-chart-deckgl @ ./plugins/legacy-preset-chart-deckgl [Superset Plugin] Use symlink source for @superset-ui/legacy-preset-chart-nvd3 @ ./plugins/legacy-preset-chart-nvd3 [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-cartodiagram @ ./plugins/plugin-chart-cartodiagram [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-echarts @ ./plugins/plugin-chart-echarts [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-handlebars @ ./plugins/plugin-chart-handlebars [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-pivot-table @ ./plugins/plugin-chart-pivot-table [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-table @ ./plugins/plugin-chart-table [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-word-cloud @ ./plugins/plugin-chart-word-cloud [Superset Plugin] Use symlink source for @superset-ui/switchboard @ ./packages/superset-ui-switchboard <w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'Compilation/modules|/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/thread-loader/dist/cjs.js!/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/babel-loader/lib/index.js??ruleSet[1].rules[1].use[1]!/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/ts-loader/index.js??ruleSet[1].rules[1].use[2]!/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/src/components/Tooltip/index.tsx': No serializer registered for WorkerError <w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> webpack/lib/ModuleBuildError -> WorkerError 1145 assets 12820 modules ERROR in ./plugins/plugin-chart-handlebars/node_modules/just-handlebars-helpers/lib/helpers/formatters.js 27:24-55 Module not found: Error: Can't resolve 'currencyformatter.js' in '/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/plugins/plugin-chart-handlebars/node_modules/just-handlebars-helpers/lib/helpers' ERROR in ./src/components/Tooltip/index.tsx Module build failed (from ./node_modules/thread-loader/dist/cjs.js): Thread Loader (Worker 0) error while reading tsconfig.json: [tsl] ERROR in /home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/tsconfig.json(20,42) TS1005: ',' expected. at PoolWorker.fromErrorObj (/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/thread-loader/dist/WorkerPool.js:362:12) at /home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/thread-loader/dist/WorkerPool.js:184:29 at mapSeries (/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/neo-async/async.js:3625:14) at PoolWorker.onWorkerMessage (/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/thread-loader/dist/WorkerPool.js:148:34) at Object.loader (/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/ts-loader/dist/index.js:18:18) ERROR in ./node_modules/@luma.gl/webgl/dist/adapter/webgl-adapter.js 65:38-62 Module not found: Error: Can't resolve './webgl-device' in '/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/@luma.gl/webgl/dist/adapter' Did you mean 'webgl-device.js'? BREAKING CHANGE: The request './webgl-device' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request. ERROR in ./tsconfig.json:20:42 TS1005: ',' expected. 18 | ], 19 | "@superset-ui/legacy-plugin-chart-*": [ > 20 | "./plugins/legacy-plugin-chart-*/src" | ^^^ 21 | ], 22 | "@superset-ui/legacy-preset-chart-*": [ 23 | "./plugins/legacy-preset-chart-*/src" webpack 5.102.1 compiled with 4 errors in 22956 ms gapinyc@DESKTOP-9QS7RL5:~/superset-prod/superset-5.0.0/superset-frontend$
最新发布
10-24
PS E:\vue\Vue3.0> npm list idealtree vue3-0@0.0.0 E:\vue\Vue3.0 └── (empty) PS E:\vue\Vue3.0> npm install idealtree npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: vite-plugin-inspect@0.8.9 npm WARN Found: vite@7.1.2 npm WARN node_modules/vite npm WARN peer vite@"^5.0.0 || ^6.0.0 || ^7.0.0" from @vitejs/plugin-vue@6.0.1 npm WARN node_modules/@vitejs/plugin-vue npm WARN dev @vitejs/plugin-vue@"^6.0.1" from the root project npm WARN 4 more (vite-hot-client, vite-plugin-vue-devtools, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer vite@"^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1" from vite-plugin-inspect@0.8.9 npm WARN node_modules/vite-plugin-vue-devtools/node_modules/vite-plugin-inspect npm WARN vite-plugin-inspect@"0.8.9" from vite-plugin-vue-devtools@7.7.7 npm WARN node_modules/vite-plugin-vue-devtools npm WARN npm WARN Conflicting peer dependency: vite@6.3.5 npm WARN node_modules/vite npm WARN peer vite@"^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1" from vite-plugin-inspect@0.8.9 npm WARN node_modules/vite-plugin-vue-devtools/node_modules/vite-plugin-inspect npm WARN vite-plugin-inspect@"0.8.9" from vite-plugin-vue-devtools@7.7.7 npm WARN node_modules/vite-plugin-vue-devtools npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/idealtree - Not found npm ERR! 404 npm ERR! 404 'idealtree@*' is not in this registry. npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: C:\Users\86138\AppData\Local\npm-cache\_logs\2025-08-15T01_20_32_816Z-debug-0.log PS E:\vue\Vue3.0> 安装的时候会有一下然后卡一下最后报错
08-16
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学徒630

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值