简体   繁体   English

maven 编译时依赖项是否必须打包以便在运行时访问?

[英]Should maven compile time dependency be necessarily packaged for access during runtime?

Should maven compile time dependency be necessarily packaged for access during runtime? maven 编译时依赖项是否必须打包以便在运行时访问?

Let's assume that there is a maven pom file for a library A. On that, maven dependency tree command is run.假设库 A 有一个 maven pom 文件。在此之上,运行 maven 依赖树命令。

And in the output, we see the following line:在 output 中,我们看到以下行:

[INFO] +- commons-pool:commons-pool:jar:1.3:compile

This means that, commons-pool.jar should be available during compilation.这意味着,commons-pool.jar 在编译期间应该可用。 Does this imply that, necessarily, commons-pool.jar should be packaged alongside library A, inorder for access during runtime?这是否意味着,commons-pool.jar 必须与库 A 一起打包,以便在运行时访问?

So the answer is yes, as Alanpatchi said.所以答案是肯定的,正如 Alanpatchi 所说。

In Maven compile dependencies are also runtime dependencies.在 Maven 中,编译依赖也是运行时依赖。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Java中将其他本地Maven项目的依赖项添加到本地Maven项目(运行时和编译时)? - How to add dependency of other local maven project to l local maven project in java (runtime and compile time)? 为什么运行时依赖项类在编译时可用? - Why are classes of runtime dependency available at compile time? 运行时未找到依赖项 maven - dependency not found at runtime maven 即使添加了Maven依赖项,编译时也会出错 - Compile time error even after adding maven dependency Maven依赖管理在测试时被忽略(在运行时工作) - Maven dependency management being ignored at test time (works at runtime) Hibernate如何在运行时而不是在编译时删除并重新创建数据库? - How to have Hibernate drop and recreate database during runtime, not at compile time? Spring Boot - 在运行时或编译时有条件地加载模块 - Spring Boot - Conditionally load module during runtime or compile-time 在运行时或编译时评估/解析左右对象? - left and right objects are evaluated / resolved during runtime or compile-time? Gradle 在编译时包括 jar 但不包括运行时 - Gradle include jar during compile time but exclude runtime Maven依赖项在编译期间有效,但在运行时java.lang.NoClassDefFoundError&java.lang.ClassNotFoundException期间失败 - maven dependencies works during compile, but fails during runtime java.lang.NoClassDefFoundError & java.lang.ClassNotFoundException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM