Maven + Tomcat

Olá a todos,

Estou tentando fazer uma aplicação usando: JSF,Tomcat 7 e o Maven, mas no momento de “subir” o .war para o tomcat acontece o erro de build no maven:

Pom.xml

	<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>br.com.cg</groupId>
	<artifactId>cg</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>Controle de gastos</name>
	<url>http://maven.apache.org</url>
	<dependencies>
		<!-- JUnit -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
		
		
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-catalina</artifactId>
			<version>7.0.34</version>
		</dependency>
            
		    
		<!-- JSF--> 
		<dependency>
			<groupId>com.sun.faces</groupId>
			<artifactId>jsf-api</artifactId>
			<version>2.1.7</version>
		</dependency>
		<dependency>
			<groupId>com.sun.faces</groupId>
			<artifactId>jsf-impl</artifactId>
			<version>2.1.7</version>
		</dependency>
 
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>1.2</version>
		</dependency>
 
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
		</dependency>
 
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.1</version>
		</dependency>

		<!-- Hibernate!!! -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>4.3.0.Beta3</version>
		</dependency>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-annotations</artifactId>
			<version>3.5.6-Final</version>
		</dependency>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>4.3.0.Beta4</version>
		</dependency>
		<dependency>
			<groupId>javassist</groupId>
			<artifactId>javassist</artifactId>
			<version>3.12.1.GA</version>
		</dependency>
		
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator</artifactId>
			<version>5.0.1.Final</version>
		</dependency>
		
		<dependency>	
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.26</version>
		</dependency>
		<!-- End Hibernate!!! -->

	</dependencies>
	<build>
		<finalName>cg</finalName>
		 
		 
		
		 
			<plugins>
		 			
			<plugin>
                 <groupId>org.apache.tomcat.maven</groupId>
  				<artifactId>tomcat7-maven-plugin</artifactId>
  				<version>2.1</version>
                <configuration>
                	<url>http://localhost:8080/manager/html</url>
                    <path>/${project.build.finalName}</path>
                    <update>true</update>
                </configuration>
                
                <executions>
					<execution>
						<id>prepare-tomcat</id>
						<phase>install</phase>
						<goals>
							<goal>deploy-only</goal>
						</goals>
					</execution>
				</executions>
            </plugin>		
		</plugins>
	</build>

</project>

E a exception:

[code]
INFO] Installing C:\Users\User\Desktop\Projetos\emAndamento\controle\cg\pom.
xml to C:\Users\User.m2\repository\br\com\cg\cg\1.0-SNAPSHOT\cg-1.0-SNAPSHOT
.pom
[INFO]
[INFO] — tomcat7-maven-plugin:2.1:deploy-only (prepare-tomcat) @ cg —
[INFO] Deploying war to http://localhost:8080/cg
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.059s
[INFO] Finished at: Thu Oct 31 21:03:52 BRST 2013
[INFO] Final Memory: 16M/172M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:
deploy-only (prepare-tomcat) on project cg: Cannot invoke Tomcat manager: Connec
tion to http://localhost:8080 refused: Connection refused: connect -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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/ConnectExcepti
on
C:\Users\User\Desktop\Projetos\emAndamento\controle\cg>mvn -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects…
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.416s
[INFO] Finished at: Thu Oct 31 21:04:27 BRST 2013
[INFO] Final Memory: 5M/106M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid li
fecycle phase or a goal in the format : or <plugin-group-id

:[:]:. Available lifecycle phases are
: validate, initialize, generate-sources, process-sources, generate-resources, p
rocess-resources, compile, process-classes, generate-test-sources, process-test-
sources, generate-test-resources, process-test-resources, test-compile, process-
test-classes, test, prepare-package, package, pre-integration-test, integration-
test, post-integration-test, verify, install, deploy, pre-site, site, post-site,
site-deploy, pre-clean, clean, post-clean. -> [Help 1]
org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specifie
d for this build. You must specify a valid lifecycle phase or a goal in the form
at : or :[:]:. Available lifecycle phases are: validate, initialize, generate-so
urces, process-sources, generate-resources, process-resources, compile, process-
classes, generate-test-sources, process-test-sources, generate-test-resources, p
rocess-test-resources, test-compile, process-test-classes, test, prepare-package
, package, pre-integration-test, integration-test, post-integration-test, verify
, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, pos
t-clean.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:104)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

[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/NoGoalSpecifie
dException[/code]

Agradeço a ajuda.

Executa o maven com o parametro -X, assim como o maven informa para você poder ver o log completo.

olá spenccer,

Obrigado pela resposta mas já coloquei no primeiro post:

[code]
[ERROR] No goals have been specified for this build. You must specify a valid li
fecycle phase or a goal in the format : or <plugin-group-id

:[:]:. Available lifecycle phases are
: validate, initialize, generate-sources, process-sources, generate-resources, p
rocess-resources, compile, process-classes, generate-test-sources, process-test-
sources, generate-test-resources, process-test-resources, test-compile, process-
test-classes, test, prepare-package, package, pre-integration-test, integration-
test, post-integration-test, verify, install, deploy, pre-clean, clean, post-cle
an, pre-site, site, post-site, site-deploy. -> [Help 1]
org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specifie
d for this build. You must specify a valid lifecycle phase or a goal in the form
at : or :[:]:. Available lifecycle phases are: validate, initialize, generate-so
urces, process-sources, generate-resources, process-resources, compile, process-
classes, generate-test-sources, process-test-sources, generate-test-resources, p
rocess-test-resources, test-compile, process-test-classes, test, prepare-package
, package, pre-integration-test, integration-test, post-integration-test, verify
, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site
-deploy.
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:104)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:153)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
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:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

[ERROR]
[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/NoGoalSpecifie
dException[/code]