maven工程下的“run as application”

为了让maven能够在Terminal窗口执行(比在Console执行方便多了,命令行总是比右键选择run要快),需要配置如下的profile;然后敲入
  mvn -test -Prun 
即可。
 
 1 <profiles>
 2         <profile>
 3             <id>run</id>
 4             <build>
 5                 <plugins>
 6                     <plugin>
 7                         <groupId>org.codehaus.mojo</groupId>
 8                         <artifactId>exec-maven-plugin</artifactId>
 9                         <version>1.6</version>
10                         <executions>
11                             <execution>
12                                 <phase>test</phase>
13                                 <goals>
14                                     <goal>java</goal>
15                                 </goals>
16                                 <configuration>
17                                     <mainClass>org.dubbo.provider.Provider</mainClass>
18                                 </configuration>
19                             </execution>
20                         </executions>
21                     </plugin>
22                 </plugins>
23             </build>
24         </profile>
25     </profiles>
 
采用这种注意工程间的依赖需要都install才能够正常跑,因为他用的jar都是从mvn仓库中取值;而不再是最新的工程间直调。

猜你喜欢

转载自www.cnblogs.com/xiashiwendao/p/9288447.html
今日推荐