2013-03-15 5 views
2

У меня проблема, когда я не буду развертывать проект maven с tomcat. Я получаю только 404. Когда я пробую это с причалом, он отлично работает.Развертывание проекта Maven в Tomcat

Я думаю, что есть что-то не так с pom.xml

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
<modelVersion>4.0.0</modelVersion> 
<groupId>com.shoot.tail</groupId> 
<artifactId>shootout</artifactId> 
<packaging>war</packaging> 
<version>1.2</version> 
<name>Shootout</name> 

<repositories> 
    <repository> 
     <id>java.net</id> 
     <url>https://maven.java.net/content/repositories/releases</url> 
    </repository> 
</repositories> 

<properties> 
    <myfaces.version>2.1.8</myfaces.version> 
    <mojarra.version>2.1.11</mojarra.version> 
    <jetty.version>8.1.5.v20120716</jetty.version> 
    <tomcat.version>7.0.12</tomcat.version> 
</properties> 

<profiles> 
    <profile> 
     <id>mojarra</id> 
     <activation> 
      <activeByDefault>false</activeByDefault> 
     </activation> 
     <dependencies> 
      <dependency> 
       <groupId>com.sun.faces</groupId> 
       <artifactId>jsf-api</artifactId> 
       <version>${mojarra.version}</version> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>com.sun.faces</groupId> 
       <artifactId>jsf-impl</artifactId> 
       <version>${mojarra.version}</version> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.tomcat</groupId> 
       <artifactId>jdbc-pool</artifactId> 
       <version>${jdbc-pool.version}</version> 
       <scope>system</scope> 
       <systemPath>${basedir}/../${web.project}/WebContent/WEB-INF/lib/tomcat-jdbc.jar</systemPath> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.tomcat</groupId> 
       <artifactId>juli</artifactId> 
       <version>${tomcat.version}</version> 
      </dependency> 
     </dependencies> 
     <properties> 
      <override-web-xml>src/main/jetty/override-mojarra-web.xml</override-web-xml> 
     </properties> 
    </profile> 
    <profile> 
     <id>myfaces</id> 
     <activation> 
      <activeByDefault>true</activeByDefault> 
     </activation> 
     <dependencies> 
      <dependency> 
       <groupId>org.apache.myfaces.core</groupId> 
       <artifactId>myfaces-api</artifactId> 
       <version>${myfaces.version}</version> 
       <scope>compile</scope> 
      </dependency> 
      <dependency> 
       <groupId>org.apache.myfaces.core</groupId> 
       <artifactId>myfaces-impl</artifactId> 
       <version>${myfaces.version}</version> 
       <scope>compile</scope> 
      </dependency> 
     </dependencies> 
     <properties> 
      <override-web-xml>src/main/jetty/override-myfaces-web.xml</override-web-xml> 
     </properties> 
    </profile> 
</profiles> 

<!-- Project dependencies --> 
<dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.0</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
     <groupId>log4j</groupId> 
     <artifactId>log4j</artifactId> 
     <version>1.2.14</version> 
     <scope>compile</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.geronimo.specs</groupId> 
     <artifactId>geronimo-servlet_3.0_spec</artifactId> 
     <version>1.0</version> 
     <scope>provided</scope> 
    </dependency> 

</dependencies> 

<build> 
    <finalName>shootout</finalName> 
    <defaultGoal>install</defaultGoal> 
    <plugins> 
     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>tomcat-maven-plugin</artifactId> 
      <version>${tomcat.version}</version> 
      <configuration> 
       <webAppConfig> 
        <contextPath>/${project.artifactId}</contextPath> 
        <overrideDescriptor>${override-web-xml}</overrideDescriptor> 
       </webAppConfig> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.mortbay.jetty</groupId> 
      <artifactId>jetty-maven-plugin</artifactId> 
      <version>${jetty.version}</version> 
      <configuration> 
       <webAppConfig> 
        <contextPath>/${project.artifactId}</contextPath> 
        <overrideDescriptor>${override-web-xml}</overrideDescriptor> 
       </webAppConfig> 
      </configuration> 
     </plugin> 
    </plugins> 
    <pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
        <encoding>UTF-8</encoding> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-eclipse-plugin</artifactId> 
       <version>2.9</version> 
       <configuration> 
        <wtpversion>2.0</wtpversion> 
        <downloadSources>true</downloadSources> 
        <additionalProjectFacets> 
         <jst.jsf>2.0</jst.jsf> 
        </additionalProjectFacets> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.tomcat.maven</groupId> 
       <artifactId>tomcat7-maven-plugin</artifactId> 
       <version>2.1</version> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
</build> 
</project> 

Версия Затмение: Juno Tomcat: 7.0.12 Maven: 3.0.5

И ошибка:

[ERROR] Plugin org.codehaus.mojo:tomcat-maven-plugin:7.0.12 or one of its depend 
encies could not be resolved: Failed to read artifact descriptor for org.codehau 
s.mojo:tomcat-maven-plugin:jar:7.0.12: Failure to find org.codehaus.mojo:tomcat- 
maven-plugin:pom:7.0.12 in http://repo.maven.apache.org/maven2 was cached in the 
local repository, resolution will not be reattempted until the update interval 
of central has elapsed or updates are forced -> [Help 1] 
org.apache.maven.plugin.PluginResolutionException: Plugin org.codehaus.mojo:tomc 
at-maven-plugin:7.0.12 or one of its dependencies could not be resolved: Failed 
to read artifact descriptor for org.codehaus.mojo:tomcat-maven-plugin:jar:7.0.12 

     at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re 
solve(DefaultPluginDependenciesResolver.java:129) 
     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginD 
escriptor(DefaultMavenPluginManager.java:142) 
     at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDes 
criptor(DefaultMavenPluginManager.java:261) 
     at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(D 
efaultBuildPluginManager.java:185) 
     at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDesc 
riptor(MojoDescriptorCreator.java:235) 
     at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalcul 
ator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106) 
     at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalcul 
ator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86) 
     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl 
eStarter.java:98) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) 
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) 
     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. 
java:57) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces 
sorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:601) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun 
cher.java:290) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav 
a:230) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La 
uncher.java:409) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 
352) 
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to 
read artifact descriptor for org.codehaus.mojo:tomcat-maven-plugin:jar:7.0.12 
     at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader. 
loadPom(DefaultArtifactDescriptorReader.java:296) 
     at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader. 
readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186) 
     at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifac 
tDescriptor(DefaultRepositorySystem.java:279) 
     at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re 
solve(DefaultPluginDependenciesResolver.java:115) 
     ... 20 more 
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure t 
o find org.codehaus.mojo:tomcat-maven-plugin:pom:7.0.12 in http://repo.maven.apa 
che.org/maven2 was cached in the local repository, resolution will not be reatte 
mpted until the update interval of central has elapsed or updates are forced 
     at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def 
aultArtifactResolver.java:538) 
     at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti 
facts(DefaultArtifactResolver.java:216) 
     at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti 
fact(DefaultArtifactResolver.java:193) 
     at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader. 
loadPom(DefaultArtifactDescriptorReader.java:281) 
     ... 23 more 
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to fi 
nd org.codehaus.mojo:tomcat-maven-plugin:pom:7.0.12 in http://repo.maven.apache. 
org/maven2 was cached in the local repository, resolution will not be reattempte 
d until the update interval of central has elapsed or updates are forced 
     at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newExcept 
ion(DefaultUpdateCheckManager.java:230) 
     at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArti 
fact(DefaultUpdateCheckManager.java:204) 
     at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def 
aultArtifactResolver.java:427) 
     ... 26 more 
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti 
onException 

Большое спасибо за помощь. С наилучшими пожеланиями Роберт

+0

вы получаете какие-либо ошибки в процессе сборки/развертывания? –

+0

Да, я добавил. – BobBarker

ответ

1

Вы указываете версию TOMCAT вместо версии кот-Maven-плагин, в результате чего специалист не найти плагин (на самом деле читает сообщение об ошибке должно быть вам помогло); здесь:

<properties> 
    <tomcat.version>7.0.12</tomcat.version> 
</properties> 
[...] 
<build> 
    <plugins> 
     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>tomcat-maven-plugin</artifactId> 
      <version>${tomcat.version}</version> 
      [...] 

Использование 1,2-СНАПШОТ (например) для $ {tomcat.version} или объявить другую переменную при использовании TOMCAT версии в другом месте.

Plus, Tomcat 7.0 потребности additional configuration для взаимодействия с менеджером веб-приложение, как это:

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>tomcat-maven-plugin</artifactId> 
    <version>1.2-SNAPSHOT</version> 
    <configuration> 
    <url>http://localhost:8080/manager/html</url> 
    </configuration> 
</plugin> 

ИЛИ, вы можете использовать версии 2.x, который был moved под апача, и где mojos были переименованы tomcat6 и tomcat7 с теми же целями.

<pluginManagement> 
    <plugins> 
    <plugin> 
     <groupId>org.apache.tomcat.maven</groupId> 
     <artifactId>tomcat6-maven-plugin</artifactId> 
     <version>2.1</version> 
    </plugin> 
    <plugin> 
     <groupId>org.apache.tomcat.maven</groupId> 
     <artifactId>tomcat7-maven-plugin</artifactId> 
     <version>2.1</version> 
    </plugin> 
    </plugins> 
</pluginManagement> 
+0

Спасибо, я еще шаг. [ПРЕДУПРЕЖДЕНИЕ] При создании эффективных настроек возникли некоторые проблемы [ПРЕДУПРЕЖДЕНИЕ] Нераспознанный тег: 'id' (позиция: START_TAG замечено ... \ n \ t ... @ 112: 8) @ C : \ Software \ maven \ conf \ settings.xml, строка 112, столбец 8 [ПРЕДУПРЕЖДЕНИЕ] [INFO] Сканирование проектов ... [ПРЕДУПРЕЖДЕНИЕ] POM для org.codehaus.mojo: tomcat-maven-plugin: банку: 1,2-ПАНОРАМА не отсутствует, информация не зависимостей доступных C: \ Software \ Maven \ конф \ settings.xml Line 112 TomcatServer админ админ BobBarker

+0

это кажется, что после переезда в апач, хранилище Codehaus только принимает версию 1.0. Прочитайте первый и второй ответы на этот вопрос: http://stackoverflow.com/questions/2013576/maven-is-failing-to-download-the-tomcat-maven-plugin-snapshot –

+0

спасибо, я думаю, что это помогло, но есть еще одна проблема, которую я опубликовал в новом ответе для лучшего чтения. – BobBarker

1

Да, это выглядит лучше.

Я думаю, что он пытается развернуть проект, но получить отказ сборки.

[INFO] Error stacktraces are turned on. 
[WARNING] 
[WARNING] Some problems were encountered while building the effective settings 
[WARNING] Unrecognised tag: 'id' (position: START_TAG seen ...<servers>\n \t<id 
>... @112:8) @ C:\Software\maven\conf\settings.xml, line 112, column 8 
[WARNING] 
[INFO] Scanning for projects... 
[WARNING] The POM for org.codehaus.mojo:tomcat7-maven-plugin:jar:2.0-SNAPSHOT is 
missing, no dependency information available 
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:tomcat7-mav 
en-plugin:2.0-SNAPSHOT: Plugin org.codehaus.mojo:tomcat7-maven-plugin:2.0-SNAPSH 
OT or one of its dependencies could not be resolved: Failed to read artifact des 
criptor for org.codehaus.mojo:tomcat7-maven-plugin:jar:2.0-SNAPSHOT 
Downloading: http://repository.apache.org/content/groups/snapshots-group/org/apa 
che/maven/plugins/maven-metadata.xml 
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xm 
l from/to apache.snapshots (http://repository.apache.org/content/groups/snapshot 
s-group/): Failed to transfer file: http://repository.apache.org/content/groups/ 
snapshots-group/org/apache/maven/plugins/maven-metadata.xml. Return code is: 500 
, ReasonPhrase:Server Error. 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Shootout 1.2 
[INFO] ------------------------------------------------------------------------ 
[WARNING] The POM for org.codehaus.mojo:tomcat7-maven-plugin:jar:2.0-SNAPSHOT is 
missing, no dependency information available 
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:tomcat7-mav 
en-plugin:2.0-SNAPSHOT: Plugin org.codehaus.mojo:tomcat7-maven-plugin:2.0-SNAPSH 
OT or one of its dependencies could not be resolved: Failed to read artifact des 
criptor for org.codehaus.mojo:tomcat7-maven-plugin:jar:2.0-SNAPSHOT 
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from h 
ttp://repository.apache.org/content/groups/snapshots-group/ was cached in the lo 
cal repository, resolution will not be reattempted until the update interval of 
apache.snapshots has elapsed or updates are forced. Original error: Could not tr 
ansfer metadata org.apache.maven.plugins/maven-metadata.xml from/to apache.snaps 
hots (http://repository.apache.org/content/groups/snapshots-group/): Failed to t 
ransfer file: http://repository.apache.org/content/groups/snapshots-group/org/ap 
ache/maven/plugins/maven-metadata.xml. Return code is: 500 , ReasonPhrase:Server 
Error. 
[INFO] 
[INFO] >>> tomcat-maven-plugin:1.1:deploy (default-cli) @ shootout >>> 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ shootout - 
-- 
[debug] execute contextualize 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, 
i.e. build is platform dependent! 
[INFO] Copying 1 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ shootout --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ sh 
ootout --- 
[debug] execute contextualize 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, 
i.e. build is platform dependent! 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ shoot 
out --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ shootout --- 
[INFO] Surefire report directory: C:\Software\workspace\shootout\target\suref 
ire-reports 

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 

Results : 

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 

[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ shootout --- 
[INFO] Packaging webapp 
[INFO] Assembling webapp [shootout] in [C:\Software\workspace\shootout\target 
\shootout] 
[INFO] Processing war project 
[INFO] Copying webapp resources [C:\Software\workspace\shootout\src\main\weba 
pp] 
[INFO] Webapp assembled in [47 msecs] 
[INFO] Building war: C:\Software\workspace\shootout\target\shootout.war 
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ig 
nored 
(webxml attribute is missing from war task, or ignoreWebxml attribute is specifi 
ed as 'true') 
[INFO] 
[INFO] <<< tomcat-maven-plugin:1.1:deploy (default-cli) @ shootout <<< 
[INFO] 
[INFO] --- tomcat-maven-plugin:1.1:deploy (default-cli) @ shootout --- 
[INFO] Deploying war to http://localhost:8080/shootout 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 3.682s 
[INFO] Finished at: Fri Mar 15 10:21:19 CET 2013 
[INFO] Final Memory: 10M/24M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy 
(default-cli) on project shootout: Cannot invoke Tomcat manager: Connection refu 
sed: connect -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o 
rg.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project shootou 
t: Cannot invoke Tomcat manager 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:217) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:153) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:145) 
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje 
ct(LifecycleModuleBuilder.java:84) 
     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje 
ct(LifecycleModuleBuilder.java:59) 
     at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu 
ild(LifecycleStarter.java:183) 
     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl 
eStarter.java:161) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) 
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) 
     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. 
java:57) 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces 
sorImpl.java:43) 
     at java.lang.reflect.Method.invoke(Method.java:601) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun 
cher.java:290) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav 
a:230) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La 
uncher.java:409) 
     at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 
352) 
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke Tomcat 
manager 
     at org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalin 
aMojo.java:149) 
     at org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarC 
atalinaMojo.java:70) 
     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default 
BuildPluginManager.java:101) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor 
.java:209) 
     ... 19 more 
Caused by: java.net.ConnectException: Connection refused: connect 
     at java.net.DualStackPlainSocketImpl.connect0(Native Method) 
     at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI 
mpl.java:69) 
     at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.ja 
va:339) 
     at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket 
Impl.java:200) 
     at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java 
:182) 
     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) 
     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) 
     at java.net.Socket.connect(Socket.java:579) 
     at java.net.Socket.connect(Socket.java:528) 
     at sun.net.NetworkClient.doConnect(NetworkClient.java:180) 
     at sun.net.www.http.HttpClient.openServer(HttpClient.java:378) 
     at sun.net.www.http.HttpClient.openServer(HttpClient.java:473) 
     at sun.net.www.http.HttpClient.<init>(HttpClient.java:203) 
     at sun.net.www.http.HttpClient.New(HttpClient.java:290) 
     at sun.net.www.http.HttpClient.New(HttpClient.java:306) 
     at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC 
onnection.java:995) 
     at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne 
ction.java:931) 
     at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection 
.java:849) 
     at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:597) 

     at org.codehaus.mojo.tomcat.TomcatManager.deployImpl(TomcatManager.java: 
662) 
     at org.codehaus.mojo.tomcat.TomcatManager.deploy(TomcatManager.java:295) 

     at org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar(AbstractDepl 
oyWarMojo.java:85) 
     at org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager(AbstractDep 
loyMojo.java:85) 
     at org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalin 
aMojo.java:141) 
     ... 22 more 
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE 
xception 

C: \ Software \ Maven \ конф \ settings.xml: Линия 111-115

<servers> 
    <id>tomcat</id> 
    <username>admin</username> 
    <password>admin</password> 
    </servers> 

pom.xml

<repositories> 
[...] 
     <repository> 
      <id>people.apache.snapshots</id> 
      <url>http://repository.apache.org/content/groups/snapshots-group/</url> 
      <releases> 
       <enabled>false</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> 
    </repositories> 
[...] 
    <pluginRepositories> 
     <pluginRepository> 
      <id>apache.snapshots</id> 
      <name>Apache Snapshots</name> 
      <url>http://repository.apache.org/content/groups/snapshots-group/</url> 
      <releases> 
       <enabled>false</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </pluginRepository> 
    </pluginRepositories> 
[...] 
    <build> 
     <finalName>shootout</finalName> 
     <defaultGoal>install</defaultGoal> 
     <plugins> 
      <plugin> 
       <groupId>org.mortbay.jetty</groupId> 
       <artifactId>jetty-maven-plugin</artifactId> 
       <version>${jetty.version}</version> 
       <configuration> 
        <webAppConfig> 
         <contextPath>/${project.artifactId}</contextPath> 
         <overrideDescriptor>${override-web-xml}</overrideDescriptor> 
        </webAppConfig> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>tomcat7-maven-plugin</artifactId> 
       <version>2.0-SNAPSHOT</version> 
       <configuration> 
        <url>http://localhost:8080/manager/html</url> 
        <server>tomcat</server> 
        <username>admin</username> 
        <password>admin</password> 
       </configuration> 
      </plugin> 
     </plugins> 
     <pluginManagement> 
      <plugins> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-compiler-plugin</artifactId> 
        <configuration> 
         <source>1.6</source> 
         <target>1.6</target> 
         <encoding>UTF-8</encoding> 
        </configuration> 
       </plugin> 
       <plugin> 
        <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-eclipse-plugin</artifactId> 
        <version>2.9</version> 
        <configuration> 
         <wtpversion>2.0</wtpversion> 
         <downloadSources>true</downloadSources> 
         <additionalProjectFacets> 
          <jst.jsf>2.0</jst.jsf> 
         </additionalProjectFacets> 
        </configuration> 
       </plugin> 

      </plugins> 
     </pluginManagement> 
    </build> 

спасибо за вашу помощь и извините о количестве вопросов. robert

4

Решено.

это мой последний pom.xml:

[...] 
    <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>tomcat-maven-plugin</artifactId> 
     <configuration> 
     <server>tomcat</server> 
     <url>http://localhost:8080/manager/text</url> 
     </configuration> 
    </plugin> 
[...] 

Спасибо Гвидо за помощь (:

2

это работает:

https://stackoverflow.com/a/16592276/503601

есть ошибка в плагине. Этот плагин не читает URL-адрес тега.

<configuration> 
    <url>http://localhost:8080/manager/html</url> 
</configuration> 

установить использовать свойство

<properties> 
    <maven.tomcat.url>http://localhost:8080/manager/text</maven.tomcat.url> 
</properties> 

полную статью в http://jvm-java.blogspot.com.es/2013/06/publish-with-maven-in-tomcat7.html

+0

Спасибо за это. Я использую версию версии tomcat7-maven-версии 2.2 и подтвердил это. Также хотелось бы отметить, что эта запись свойств ДОЛЖНА быть жестко закодирована в каждом файле pom, с которым вы начнете войну. Например, в моем случае у меня есть общий родительский проект maven maven, который наследует все мои военные проекты войны, и обычно я помещаю общие свойства в родительский pom. Для этого конкретного свойства игнорируется любое значение/URI, которое вы помещаете в родительский pom. Я даже пытался создать настраиваемое свойство в родительском объекте и вводить его как $ {myCustonUri} всегда игнорировать – Selwyn