maven plugin :maven-war-plugin package 时出错,请maven高手指教

laserdance 发布于 2012/09/24 18:19
阅读 11K+
收藏 1
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal '' in plugin org.apache.maven.plugins:maven-war-plugin:2.1.1 among available goals help, manifest, inplace, war, exploded -> [Help 1]
org.apache.maven.plugin.MojoNotFoundException: Could not find goal '' in plugin org.apache.maven.plugins:maven-war-plugin:2.1.1 among available goals help, manifest, inplace, war, exploded
	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:267)
	at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
	at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:235)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.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:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException

上述代码为ubuntu eclipse 下用maven 3 运行时出的错误,同样的文件在win XP下无此现象发生:

调用的maven 命令: clean  package   war: inplace  -X -e

然后控制台就报这个错误,这是个web项目,使用的父类中的pom配置

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<configuration>
					<excludeDefaultDirectories>true</excludeDefaultDirectories>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<target>1.6</target>
					<source>1.6</source>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.1.1</version>
			</plugin>

请看最后一个plugin,看控制台提示是说我没有指定goal ,但我对maven这个编译过程不太熟悉,请指教怎么配置goal,或是其它问题导致呢。

加载中
0
laserdance
laserdance
我想说 我想撞墙,不是一直提示 '' 这个goal没有吗,,,在ubuntu下的命令的inplace 前面有一个小小的空格 。。。。。
0
DW_GYT
DW_GYT

前些天在stackOverflow正好碰到这个问题,你可以看看这个:http://stackoverflow.com/questions/8587971/unable-to-load-the-mojo-maven-install

0
laserdance
laserdance
按上面所说是自己安装的m2eclipse。但我这个是eclipse自带的maven,另外文中有回复提到是在update indexes的时候强制中断了eclipse,我就是这种情况下杀掉进程中断的。导致出现上述错误 ,我按stackoverflow所说的试过都没有产生作用。我再慢慢找找。谢谢楼上回复 
0
杨延庆
杨延庆
你用纯的maven命令试过么?
0
laserdance
laserdance
纯命令是可以的
返回顶部
顶部