2012-09-12 13 views
5

Bir süredir Eclipse kullanıyordum, şimdi de web projelerini kaynak olarak yazıyordum ama ben de maven'e bakmaya başladım. Tutuklanan maven ile güzel bir örnek web projesi yaptım ama eğer projeye sağ tıklarsam bir WAR dosyasına artık ihracat yapılamam. Savaş dosyamı sunucuya nasıl yüklerim? pom.xml'ime bir şey koymak zorunda mıyım?Bir savaş dosyasına nasıl dosya aktarılır eclipse'deki maven projem

<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>org.springsource.greenbeans.maven</groupId> 
    <artifactId>WebFlowTemplate</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>WebFlowTemplate Maven Webapp</name> 
    <url>http://maven.apache.org</url> 
    <dependencies> 

     <dependency> 
      <groupId>jstl</groupId> 
      <artifactId>jstl</artifactId> 
      <version>1.2</version> 
     </dependency> 

     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-core</artifactId> 
      <version>3.6.3.Final</version> 
     </dependency> 

     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-validator</artifactId> 
      <version>4.3.0.Final</version> 
     </dependency> 

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

     <dependency> 
      <groupId>org.aspectj</groupId> 
      <artifactId>aspectjtools</artifactId> 
      <version>1.6.2</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-aspects</artifactId> 
      <version>3.1.2.RELEASE</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-context</artifactId> 
      <version>3.1.2.RELEASE</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.webflow</groupId> 
      <artifactId>spring-webflow</artifactId> 
      <version>2.3.1.RELEASE</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-core</artifactId> 
      <version>3.1.2.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-web</artifactId> 
      <version>3.1.2.RELEASE</version> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.security</groupId> 
      <artifactId>spring-security-config</artifactId> 
      <version>3.1.2.RELEASE</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-aop</artifactId> 
      <version>3.1.2.RELEASE</version> 
     </dependency> 


     <dependency> 
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
      <version>1.2.17</version> 
     </dependency> 



    </dependencies> 
    <build> 
     <finalName>WebFlowTemplate</finalName> 
    </build> 
</project> 
+0

belki "mvn paketinin" çıktısını paylaşabilir misiniz ... mvn Tutulma çalıştırmak yapılandırmaları gelen gol yüklemek yürütebilirsiniz çalıştırmak? – pagid

+0

huh ... Eclipse hakkında konuşuyorum Ben sağ fare tıklaması ve savaşa ihracat için bir seçenek vardı – PartyWithJohn

cevap

5

Kullanım maven eklentileri maven-derleyici-eklentisi, maven savaş-eklentisi, örn::

<build> 
    <plugins> 
     ... 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.0.2</version> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
       <encoding>${project.build.sourceEncoding}</encoding> 
       <showWarnings>true</showWarnings> 
       <showDeprecation>true</showDeprecation> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>2.1-beta-1</version> 
      <configuration> 
       <failOnMissingWebXml>false</failOnMissingWebXml> 
       <webappDirectory>${project.build.directory}/${project.artifactId}</webappDirectory> 
       <warName>${project.artifactId}_${noVer}</warName> 
       <archive> 
        <addMavenDescriptor>false</addMavenDescriptor> 
        <manifest> 
         <addClasspath>false</addClasspath> 
        </manifest> 
        <manifestEntries/> 
        <manifestFile/> 
       </archive> 
      </configuration> 
     </plugin> 
     ... 
    </plugins> 
    <finalName>${project.artifactId}-${project.version}</finalName> 
</build> 

bana yardım edin .... benim pom.xml şudur Ve sonra basitçe: WAR dosyası oluşturacak .

Sen

İlgili konular