eclipse 不同的 maven 构建在同一个 pom 文件中。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9810236/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
difference maven build in same pom file.
提问by Idan
i have a parent pom file that include 3 module...
我有一个包含 3 个模块的父 pom 文件...
and there is difference when i run "mvn install" from command line on the "parent pom" to eclipse m2 plugin (run-- maven install).
当我从“父 pom”上的命令行运行“mvn install”到 eclipse m2 插件(运行--maven 安装)时,存在差异。
i can see it when i run from command line it's not and after that try to run "clean" on my tomcat server it show me this error:
当我从命令行运行时,我可以看到它不是,然后尝试在我的 tomcat 服务器上运行“clean”,它向我显示此错误:
Publishing failed Publishing failed with multiple errors
发布失败 发布失败,出现多个错误
File not found: D:\Projects\starto-v1\Tomcat Servlet\target\m2e-wtp\web-resources\META-INF\MANIFEST.MF.
File not found: D:\Projects\starto-v1\Tomcat Servlet\target\m2e-wtp\web-resources\META-INF\maven\starto.starto\MavenWeb-starto\pom.properties.
File not found: D:\Projects\starto-v1\Tomcat Servlet\target\m2e-wtp\web-resources\META-INF\maven\starto.starto\MavenWeb-starto\pom.xml.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/MeetReq/MeetReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/MeetReq/MeetReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/MsgReq/MsgReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/MsgReq/MsgReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/Servlets/HelloWorldServlet.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/Servlets/LocUpdateServlet.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/Servlets/MeetServlet.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/Servlets/MsgServlet.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/Servlets/SearchServlet.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/Servlets/SingInUpOut.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/Servlets/c2dm.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/Servlets/imAlive.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/c2dm/FakeHostnameVerifier.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/c2dm/NameValuePair.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/c2dm/c2dmReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/c2dm/c2dmReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/db/managment/Dbconnection.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/db/managment/DbquaryExecutor.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/net/viralpatel/maven/ReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/search/SearchReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/servlet/common/CommonFun.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/signInUpOutReq/SignInUpOutReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/signInUpOutReq/SignInUpOutReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/update/imAlive/IsAliveChecker.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/update/imAlive/IsAliveCheckerThread.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/update/imAlive/imAliveReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/update/imAlive/imAliveReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/update/loc/req/UpdateLocReqHandler.class'.
Resource is out of sync with the file system: '/MavenWeb-starto/target/classes/update/loc/req/UpdateLocReqHandler.class'.
File not found: D:\Projects\starto-v1\Hibernett\target\classes\META-INF\maven\starto.starto\Hibernet-starto\pom.properties.
Resource is out of sync with the file system: '/Common-starto/target/classes/Entities/LocationStartTo.class'.
(this file he throw "File not found" they really not there...)
(他抛出的这个文件“找不到文件”,他们真的不存在......)
but if i go to my parent pom run-->"maven install" it's run just fine with no error when i try to clean..
但是如果我去我的父 pom run-->"maven install" 它运行得很好,当我尝试清理时没有错误..
what could be the reason?
可能是什么原因?
i try to see if "my maven" that run in command line is different maven from eclipse but i didn't find which maven run in eclipse...
我尝试查看在命令行中运行的“我的 maven”是否与 eclipse 中的 maven 不同,但我没有找到在 eclipse 中运行的 maven...
thanks in advance..
提前致谢..
sorry for my English...
对不起我的英语不好...
回答by fmucar
When you run maven outside of eclipse, files are changed outside of eclipse. What you need to do is, refresh (f5) your project within eclipse after building it via maven outside of eclipse. Then that "out of sync" error will go away.
当您在 eclipse 之外运行 maven 时,文件会在 eclipse 之外更改。您需要做的是,在 eclipse 之外通过 Maven 构建项目后,在 eclipse 中刷新(f5)您的项目。然后那个“不同步”错误就会消失。
window -> preferences -> maven -> installations ->
you can change maven installation from here if you need to
如果需要,您可以从这里更改 maven 安装