Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/393.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven:versions:updateparent后跟install安装旧版本_Java_Maven_Build_Multi Module_Versions Maven Plugin - Fatal编程技术网

Java Maven:versions:updateparent后跟install安装旧版本

Java Maven:versions:updateparent后跟install安装旧版本,java,maven,build,multi-module,versions-maven-plugin,Java,Maven,Build,Multi Module,Versions Maven Plugin,我有以下两个maven项目 pom.xml (parent) -- 唯一定义工件版本的地方是父级。其他项目或其模块直接或间接从父项目继承该版本。我想自动将聚合版本及其模块版本与父级匹配 在我升级了父版本并安装了mvn之后,我尝试使用versions maven plugin升级聚合项目及其模块,以使用以下命令匹配新的父版本: mvn版本:更新父版本:更新子模块干净安装 聚合父级和模块父级已正确升级,但是安装目标仍会在版本maven插件所做更改之前安装版本。如果我想安装升级版本,我必须在vers

我有以下两个maven项目

pom.xml (parent)
--

唯一定义工件版本的地方是父级。其他项目或其模块直接或间接从父项目继承该版本。我想自动将聚合版本及其模块版本与父级匹配

在我升级了父版本并安装了mvn之后,我尝试使用versions maven plugin升级聚合项目及其模块,以使用以下命令匹配新的父版本:

mvn版本:更新父版本:更新子模块干净安装

聚合父级和模块父级已正确升级,但是安装目标仍会在版本maven插件所做更改之前安装版本。如果我想安装升级版本,我必须在
versions
插件之后分别调用
mvn clean install
。为什么
install
不在同一个命令中选择
versions
插件所做的更改?我还试图包括
版本:commit
,但没有效果。下面是显示正在发生的事情的构建日志

tutoivon@IT-L-R90HKRNH MINGW64 ~/Desktop/mavenversiontest/aggregate (master)
$ mvn versions:update-parent versions:update-child-modules clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] aggregate
[INFO] module
[INFO] submodule
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.4:update-parent (default-cli) @ aggregate ---
[INFO] Updating parent from 1.0.0 to 2.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building module 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.4:update-parent (default-cli) @ module ---
[INFO] Project's parent is part of the reactor
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building submodule 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.4:update-parent (default-cli) @ submodule ---
[INFO] Project's parent is part of the reactor
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.4:update-child-modules (default-cli) @ aggregate ---
[INFO] Module: module
[INFO]     parent was fi.tuomas.testi:aggregate:1.0.0
[INFO]     updated to fi.tuomas.testi:aggregate:2.0.0
[INFO] Module: module/submodule
[INFO]     parent was fi.tuomas.testi:module:1.0.0
[INFO]     updated to fi.tuomas.testi:module:2.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ aggregate ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ aggregate ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\aggregate\1.0.0\aggregate-1.0.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building module 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ module ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ module ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\module\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\module\1.0.0\module-1.0.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building submodule 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ submodule ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ submodule ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\module\submodule\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\submodule\1.0.0\submodule-1.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] aggregate .......................................... SUCCESS [  0.125 s]
[INFO] module ............................................. SUCCESS [  0.010 s]
[INFO] submodule .......................................... SUCCESS [  0.011 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.626 s
[INFO] Finished at: 2017-09-05T11:03:49+03:00
[INFO] Final Memory: 15M/303M
[INFO] ------------------------------------------------------------------------

tutoivon@IT-L-R90HKRNH MINGW64 ~/Desktop/mavenversiontest/aggregate (master)
$ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] aggregate
[INFO] module
[INFO] submodule
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ aggregate ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ aggregate ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\aggregate\2.0.0\aggregate-2.0.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building module 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ module ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ module ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\module\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\module\2.0.0\module-2.0.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building submodule 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ submodule ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ submodule ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\module\submodule\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\submodule\2.0.0\submodule-2.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] aggregate .......................................... SUCCESS [  0.333 s]
[INFO] module ............................................. SUCCESS [  0.012 s]
[INFO] submodule .......................................... SUCCESS [  0.012 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.448 s
[INFO] Finished at: 2017-09-05T11:04:10+03:00
[INFO] Final Memory: 7M/240M
[INFO] ------------------------------------------------------------------------

Maven在解析了所有依赖版本后运行versions插件,因此没有办法调用它两次。一次用于更新版本,然后构建项目


maven执行阶段在中有很好的解释。请特别参阅步骤7。

Maven在解析所有依赖版本后运行版本插件,因此无法调用它两次。一次用于更新版本,然后构建项目

maven执行阶段在中有很好的解释。具体见第7步

tutoivon@IT-L-R90HKRNH MINGW64 ~/Desktop/mavenversiontest/aggregate (master)
$ mvn versions:update-parent versions:update-child-modules clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] aggregate
[INFO] module
[INFO] submodule
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.4:update-parent (default-cli) @ aggregate ---
[INFO] Updating parent from 1.0.0 to 2.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building module 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.4:update-parent (default-cli) @ module ---
[INFO] Project's parent is part of the reactor
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building submodule 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.4:update-parent (default-cli) @ submodule ---
[INFO] Project's parent is part of the reactor
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- versions-maven-plugin:2.4:update-child-modules (default-cli) @ aggregate ---
[INFO] Module: module
[INFO]     parent was fi.tuomas.testi:aggregate:1.0.0
[INFO]     updated to fi.tuomas.testi:aggregate:2.0.0
[INFO] Module: module/submodule
[INFO]     parent was fi.tuomas.testi:module:1.0.0
[INFO]     updated to fi.tuomas.testi:module:2.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ aggregate ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ aggregate ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\aggregate\1.0.0\aggregate-1.0.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building module 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ module ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ module ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\module\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\module\1.0.0\module-1.0.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building submodule 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ submodule ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ submodule ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\module\submodule\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\submodule\1.0.0\submodule-1.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] aggregate .......................................... SUCCESS [  0.125 s]
[INFO] module ............................................. SUCCESS [  0.010 s]
[INFO] submodule .......................................... SUCCESS [  0.011 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.626 s
[INFO] Finished at: 2017-09-05T11:03:49+03:00
[INFO] Final Memory: 15M/303M
[INFO] ------------------------------------------------------------------------

tutoivon@IT-L-R90HKRNH MINGW64 ~/Desktop/mavenversiontest/aggregate (master)
$ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] aggregate
[INFO] module
[INFO] submodule
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building aggregate 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ aggregate ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ aggregate ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\aggregate\2.0.0\aggregate-2.0.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building module 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ module ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ module ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\module\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\module\2.0.0\module-2.0.0.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building submodule 2.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ submodule ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ submodule ---
[INFO] Installing C:\Users\tutoivon\Desktop\mavenversiontest\aggregate\module\submodule\pom.xml to C:\Users\tutoivon\.m2\repository\fi\tuomas\testi\submodule\2.0.0\submodule-2.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] aggregate .......................................... SUCCESS [  0.333 s]
[INFO] module ............................................. SUCCESS [  0.012 s]
[INFO] submodule .......................................... SUCCESS [  0.012 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.448 s
[INFO] Finished at: 2017-09-05T11:04:10+03:00
[INFO] Final Memory: 7M/240M
[INFO] ------------------------------------------------------------------------