2010-12-21 76 views
0
<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"> 
    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>exec-maven-plugin</artifactId> 

     <executions> 
      <execution> 
      <goals> 
       <goal>java</goal> 
      </goals> 
      </execution> 
     </executions> 

     <configuration> 
      <mainClass>uk.co.vinoth.spring.App</mainClass> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 

    <modelVersion>4.0.0</modelVersion> 
    <groupId>uk.co.vinoth.spring</groupId> 
    <artifactId>spring-intergation</artifactId> 
    <packaging>jar</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>spring-intergation</name> 
    <url>http://maven.apache.org</url> 
    <dependencies> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring</artifactId> 
     <version>2.5.5</version> 
    </dependency> 

    <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-webmvc</artifactId> 
    <version>2.5.6</version> 
    </dependency> 

<dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>servlet-api</artifactId> 
     <version>2.5</version> 
</dependency> 
<dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.4</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring</artifactId> 
      <version>2.5.5</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-test</artifactId> 
      <version>2.5.5</version> 
     </dependency> 
     <dependency> 
      <groupId>postgresql</groupId> 
      <artifactId>postgresql</artifactId> 
      <version>8.3-603.jdbc4</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-dbcp</groupId> 
      <artifactId>commons-dbcp</artifactId> 
      <version>1.2.2</version> 
     </dependency> 
     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate</artifactId> 
      <version>3.2.6.ga</version> 
      <exclusions> 
       <exclusion> 
        <groupId>javax.transaction</groupId> 
        <artifactId>jta</artifactId> 
       </exclusion> 
      </exclusions> 
     </dependency> 

     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-tools</artifactId> 
      <version>3.2.0.ga</version> 
     </dependency> 
     <dependency> 
      <groupId>geronimo-spec</groupId> 
      <artifactId>geronimo-spec-jta</artifactId> 
      <version>1.0-M1</version> 
      <scope>test</scope> 
     </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-validator</artifactId> 
     <version>3.0.0.ga</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-commons-annotations</artifactId> 
     <version>3.3.0.ga</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-entitymanager</artifactId> 
     <version>3.3.2.GA</version> 
    </dependency> 

    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 

    <dependency> 
      <groupId>javax.persistence</groupId> 
      <artifactId>persistence-api</artifactId> 
      <version>1.0</version> 
    </dependency> 

    <!-- MySQL database driver --> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>5.1.9</version> 
    </dependency> 

    <!-- Hibernate library dependecy start --> 
    <dependency> 
     <groupId>dom4j</groupId> 
     <artifactId>dom4j</artifactId> 
     <version>1.6.1</version> 
    </dependency> 

    <dependency> 
     <groupId>commons-logging</groupId> 
     <artifactId>commons-logging</artifactId> 
     <version>1.1.1</version> 
    </dependency> 

    <dependency> 
     <groupId>commons-collections</groupId> 
     <artifactId>commons-collections</artifactId> 
     <version>3.2.1</version> 
    </dependency> 

    <dependency> 
     <groupId>antlr</groupId> 
     <artifactId>antlr</artifactId> 
     <version>2.7.7</version> 
    </dependency> 

    </dependencies> 
</project> 

这是我的POM.XML,当我尝试打包它的mvn包时,它创建了一个jar文件而不是一个war文件。打包成war文件

回答

4
<packaging>jar</packaging> 

也许这应该是war?我不使用Maven,所以我只是猜测。

3

更改此行:

<packaging>war</packaging>