myEclipse 中使用maven命令 Tomcat:run没有任何反应,控制台console也没有输出任何语句

来源:互联网 发布:历史优化必修一答案 编辑:程序博客网 时间:2024/06/05 10:59

建立一个maven项目,使用命令运行Tomcat的时候没有任何反应,控制台也没有任何输出语句。只是小红方框红了一下就灰掉了(首先确定你的项目没有错误,至于jar包如果连接网路请不用担心,maven会自动下载)。

问题解决:

1.首先在导航栏“Windows”里面找到“preference”。


2.搜索“Install ”myeclipse会按照提示给你列出选项。选中你使用的jdk然后点击“edit”。


3.在红色框中添加如图所示的一行代码,代码如下:

-Dmaven.multiModuleProjectDirectory=$MAVEN_HOME

这里的$MAVEN_HOME指的是你在配置的maven的环境变量,这个环境变量的值是maven在你电脑里的安装路径。然后就可以运行maven命令了。


4.如果电脑联网了,遇见下面提示不要慌张,那是maven仓库在下载相应的jar文件(简单列出一部分,我的jar包下载的太多了*_*)。

[INFO] Scanning for projects...[WARNING] [WARNING] Some problems were encountered while building the effective model for com.hry.bos:mavenbos:war:0.0.1-SNAPSHOT[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 111, column 12[WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.[WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.[WARNING] [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom (10 kB at 3.8 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom (11 kB at 14 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/23/maven-parent-23.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/23/maven-parent-23.pom (33 kB at 29 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/13/apache-13.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/apache/13/apache-13.pom (14 kB at 20 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.jar (43 kB at 42 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom (8.1 kB at 12 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar (30 kB at 34 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom (10 kB at 19 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom (14 kB at 23 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.jar[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.jar (30 kB at 35 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.2/maven-war-plugin-2.2.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.2/maven-war-plugin-2.2.pom (6.5 kB at 10 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.2/maven-war-plugin-2.2.jar[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.2/maven-war-plugin-2.2.jar (79 kB at 61 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom (5.6 kB at 11 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.jar[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.jar (27 kB at 36 kB/s)[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom
5.最后看到如下信息就说明运行成功了(主要看第一行)。

[INFO] Running war on http://localhost:8080/mavenbos[INFO] Creating Tomcat server configuration at G:\MyEclipse 10\mavenbos\target\tomcat十二月 18, 2017 12:19:12 上午 org.apache.catalina.startup.Embedded start信息: Starting tomcat server十二月 18, 2017 12:19:12 上午 org.apache.catalina.core.StandardEngine start信息: Starting Servlet Engine: Apache Tomcat/6.0.29十二月 18, 2017 12:19:13 上午 org.apache.catalina.core.ApplicationContext log信息: Initializing Spring root WebApplicationContext00:19:13,307  INFO ContextLoader:272 - Root WebApplicationContext: initialization started00:19:13,388  INFO XmlWebApplicationContext:510 - Refreshing Root WebApplicationContext: startup date [Mon Dec 18 00:19:13 CST 2017]; root of context hierarchy00:19:13,428  INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from class path resource [applicationContext.xml]00:19:13,719  INFO DefaultListableBeanFactory:577 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@ecb39d: defining beans []; root of factory hierarchy00:19:13,719  INFO ContextLoader:301 - Root WebApplicationContext: initialization completed in 411 ms00:19:14,099  INFO XmlConfigurationProvider:42 - Parsing configuration file [struts-default.xml]00:19:14,139  INFO XmlConfigurationProvider:42 - Parsing configuration file [struts-plugin.xml]00:19:14,149  INFO XmlConfigurationProvider:42 - Parsing configuration file [struts.xml]00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (spring) for (com.opensymphony.xwork2.ObjectFactory)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.FileManagerFactory)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.XWorkConverter)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.TextProvider)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.LocaleProvider)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.ActionProxyFactory)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ObjectTypeDeterminer)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.dispatcher.mapper.ActionMapper)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (jakarta) for (org.apache.struts2.dispatcher.multipart.MultiPartRequest)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.views.freemarker.FreemarkerManager)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.components.UrlRenderer)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.validator.ActionValidatorManager)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.ValueStackFactory)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionProvider)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionContextFactory)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.PatternMatcher)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.dispatcher.StaticContentLoader)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.UnknownHandlerManager)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.views.util.UrlHelper)00:19:14,149  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.CollectionConverter)00:19:14,159  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.ArrayConverter)00:19:14,159  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.DateConverter)00:19:14,159  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.NumberConverter)00:19:14,159  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.StringConverter)00:19:14,159  INFO DefaultConfiguration:42 - Overriding property struts.i18n.reload - old value: false new value: true00:19:14,159  INFO DefaultConfiguration:42 - Overriding property struts.configuration.xml.reload - old value: false new value: true00:19:14,169  INFO StrutsSpringObjectFactory:42 - Initializing Struts-Spring integration...00:19:14,169  INFO SpringObjectFactory:42 - Setting autowire strategy to name00:19:14,169  INFO StrutsSpringObjectFactory:42 - ... initialized Struts-Spring integration successfully十二月 18, 2017 12:19:14 上午 org.apache.coyote.http11.Http11Protocol init信息: Initializing Coyote HTTP/1.1 on http-8080十二月 18, 2017 12:19:14 上午 org.apache.coyote.http11.Http11Protocol start信息: Starting Coyote HTTP/1.1 on http-8080



阅读全文
0 0
原创粉丝点击