当前位置:   article > 正文

Java web项目变成maven项目解决方案_javaweb项目转成maven项目

javaweb项目转成maven项目

web项目下面添加多一个pom.xml就可以变成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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>hk.edu.vtc</groupId>
   <artifactId>acm</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <packaging>war</packaging>
   <name>acm</name>
   
   <dependencies>
      <dependency>
         <groupId>javax.activation</groupId>
         <artifactId>activation</artifactId>
         <version>1.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/activation-1.1.jar</systemPath>
      </dependency>
      
       <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
            <scope>system</scope>
           <systemPath>${basedir}/WebRoot/WEB-INF/lib/ojdbc6.jar</systemPath>
       </dependency>
    
      <dependency>
         <groupId>commons-beanutils</groupId>
         <artifactId>commons-beanutils</artifactId>
         <version>1.8.3</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-beanutils-1.8.3.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>net.sf.ingenias</groupId>
         <artifactId>common-codec</artifactId>
         <version>1.3</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-codec-1.3.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>commons-collections</groupId>
         <artifactId>commons-collections</artifactId>
         <version>3.2</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-collections-3.2.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>commons-configuration</groupId>
         <artifactId>commons-configuration</artifactId>
         <version>1.2</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-configuration-1.2.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>commons-digester</groupId>
         <artifactId>commons-digester</artifactId>
         <version>1.8</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-digester-1.8.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>commons-discovery</groupId>
         <artifactId>commons-discovery</artifactId>
         <version>0.4</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-discovery-0.4.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>commons-el</groupId>
         <artifactId>commons-el</artifactId>
         <version>1.0</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-el.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>commons-fileupload</groupId>
         <artifactId>commons-fileupload</artifactId>
         <version>1.2.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-fileupload-1.2.1.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>commons-lang</groupId>
         <artifactId>commons-lang</artifactId>
         <version>2.4</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-lang-2.4.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
         <version>1.1.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-logging-1.1.1.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>encryption</groupId>
         <artifactId>encryption</artifactId>
         <version>1.0</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/encryption.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>org.owasp.esapi</groupId>
         <artifactId>esapi</artifactId>
         <version>2.0.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/esapi-2.0.1.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>org.apache.ibatis</groupId>
         <artifactId>ibatis-sqlmap</artifactId>
         <version>2.3.0</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/ibatis-2.3.0.677.jar</systemPath>
      </dependency>
      <dependency>
          <groupId>apache-oro</groupId>
          <artifactId>jakarta-oro</artifactId>
          <version>2.0.8</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/jakarta-oro.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>org.jopendocument</groupId>
         <artifactId>jdom</artifactId>
         <version>1.1.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/jdom.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>com.sun.facelets</groupId>
         <artifactId>jsf-facelets</artifactId>
         <version>1.1.14</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/jsf-facelets-1.1.14.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>jstl</artifactId>
         <version>1.2</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/jstl-1.2.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>ldapfilt</groupId>
         <artifactId>ldapfilt</artifactId>
         <version>1.0</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/ldapfilt.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>ldapsdk</groupId>
         <artifactId>ldapsdk</artifactId>
         <version>4.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/ldapjdk.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>ldapsp</groupId>
         <artifactId>ldapsp</artifactId>
         <version>1.0</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/ldapsp.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
         <version>1.2.13</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/log4j.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>javax.mail</groupId>
         <artifactId>mail</artifactId>
         <version>1.4.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/mail-1.4.1.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>org.apache.myfaces.core</groupId>
         <artifactId>myfaces-api</artifactId>
         <version>1.2.12</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/myfaces-api-1.2.12.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>org.apache.myfaces.core</groupId>
         <artifactId>myfaces-impl</artifactId>
         <version>1.2.12</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/myfaces-impl-1.2.12.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>net.sourceforge.nekohtml</groupId>
         <artifactId>nekohtml</artifactId>
         <version>1.9.12</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/nekohtml-1.9.12.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>taglibs</groupId>
         <artifactId>standard</artifactId>
         <version>1.1.2</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/standard.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>struts</groupId>
         <artifactId>struts-legacy</artifactId>
         <version>1.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/struts-legacy.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>struts</groupId>
         <artifactId>struts</artifactId>
         <version>1.1</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/struts.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>org.apache.myfaces.trinidad</groupId>
         <artifactId>trinidad-api</artifactId>
         <version>1.2.15</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/trinidad-api-1.2.15.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>org.apache.myfaces.trinidad</groupId>
         <artifactId>trinidad-impl</artifactId>
         <version>1.2.15</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/trinidad-impl-1.2.15.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>xerces</groupId>
         <artifactId>xerces</artifactId>
         <version>2.6.2</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/xerces.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>xerces</groupId>
         <artifactId>xercesImpl</artifactId>
         <version>2.6.2</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/xercesImpl-2.6.2.jar</systemPath>
      </dependency>
      <dependency>
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
          <version>2.0.2</version>
         <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/xml-apis.jar</systemPath>
      </dependency>
      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>javax.servlet-api</artifactId>
         <version>3.1.0</version>
         <scope>provided</scope>
      </dependency>
      
      
       <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.10.1</version>
           <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/poi-3.10.1-20140818.jar</systemPath>
        </dependency>

        <dependency>  
           <groupId>org.apache.poi</groupId>  
           <artifactId>poi-ooxml</artifactId>  
           <version>3.10.1</version>  
           <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/poi-ooxml-3.10.1-20140818.jar</systemPath>
       </dependency>
         
      <dependency>  
           <groupId>org.apache.poi</groupId>  
           <artifactId>poi-ooxml-schemas</artifactId>  
           <version>3.10.1</version>
            <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/poi-ooxml-schemas-3.10.1-20140818.jar</systemPath>  
       </dependency>  

      <dependency>  
          <groupId>dom4j</groupId>  
          <artifactId>dom4j</artifactId>  
          <version>1.6.1</version>  
          <scope>system</scope>
         <systemPath>${basedir}/WebRoot/WEB-INF/lib/dom4j-1.6.1.jar</systemPath>  
      </dependency>
      
       <dependency>
            <groupId>axis-ant</groupId>
            <artifactId>axis-ant-java</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/WebRoot/WEB-INF/lib/axis-ant.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>axis</groupId>
            <artifactId>axis-java</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/WebRoot/WEB-INF/lib/axis.jar</systemPath>
        </dependency>
        
       <dependency>  
         <groupId>org.apache.axis</groupId>  
         <artifactId>axis-jaxrpc</artifactId>  
         <version>1.3</version>  
         <scope>system</scope>
          <systemPath>${basedir}/WebRoot/WEB-INF/lib/axis-jaxrpc-1.3.jar</systemPath>
       </dependency>
        
      <dependency>  
           <groupId>org.apache.xmlbeans</groupId>  
           <artifactId>xmlbeans</artifactId>  
           <version>2.6.0</version>  
           <scope>system</scope>
            <systemPath>${basedir}/WebRoot/WEB-INF/lib/xmlbeans-2.6.0.jar</systemPath>
       </dependency>
       
       <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <version>2.4</version>
            <classifier>jdk15</classifier>
            <scope>system</scope>
            <systemPath>${basedir}/WebRoot/WEB-INF/lib/json-lib-2.4-jdk15.jar</systemPath>
        </dependency>
        
         <dependency>  
            <groupId>org.apache.commons</groupId>  
            <artifactId>commons-collections4</artifactId>  
            <version>4.1</version>
            <scope>system</scope>
             <systemPath>${basedir}/WebRoot/WEB-INF/lib/commons-collections4-4.1.jar</systemPath>  
       </dependency> 
       
       <dependency>  
            <groupId>com.thoughtworks.xmorph</groupId>  
            <artifactId>ezmorph</artifactId>  
            <version>1.0.6</version>  
            <scope>system</scope>  
            <systemPath>${basedir}/WebRoot/WEB-INF/lib/ezmorph-1.0.6.jar</systemPath>  
       </dependency>
       
        <dependency>  
            <groupId>com.yourcompany</groupId>  
            <artifactId>nls-charset12</artifactId>  
            <version>1.0</version>  
            <scope>system</scope>  
            <systemPath>${basedir}/WebRoot/WEB-INF/lib/nls_charset12.jar</systemPath>  
       </dependency> 
       
   </dependencies>
   
   <build>
      <finalName>acm</finalName>
      <sourceDirectory>src</sourceDirectory>
      <resources>
         <resource>
            <directory>src</directory>
            <excludes>
               <exclude>**/*.java</exclude>
            </excludes>
         </resource>
      </resources>
      <plugins>
         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5</version>  
            <configuration>
               <source>1.6</source>
               <target>1.6</target>
            </configuration>
         </plugin>
         <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.0.0</version>
            <configuration>
               <warSourceDirectory>WebRoot</warSourceDirectory>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小惠珠哦/article/detail/936244
推荐阅读
相关标签
  

闽ICP备14008679号