如何在maven中将已编译代码的位置更改为WAR文件

时间:2014-06-30 11:01:28

标签: java maven

我有一个项目需要将编译的源代码放入WAR文件而不是maven中的默认位置目标/ classses文件夹。

我尝试过很多东西,但它没有用,有没有人知道在这里可以做些什么。

http://fusesource.com/docs/esbent/7.0/esb_deploy_osgi/BuildWar-Modify.html#BuildWar-Modify-WebInf

我尝试了上述链接及其帮助,但它无效。

的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>com.Avizva.FBVision</groupId>
  <artifactId>Enrollment_GUID</artifactId>
  <packaging>war</packaging>
  <name>Enrollment_GUID</name>
  <build>
    <sourceDirectory>${basedir}/src</sourceDirectory>
<resources>
      <resource>
        <directory>${basedir}/src</directory>
        <includes>
        <include>**/*.properties</include>
         <include>**/*.java</include>
        </includes>

      </resource>
    </resources>
    <plugins>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>


      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <configuration>
        <warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
          <warName>Enrollment_GUID</warName>
          <packagingIncludes>WEB-INF/lib/*.jar,WEB-INF/wsdl/*.xsd,WEB-INF/wsdl/*.wsdl,WEB-INF/properties/*.properties,**/*.xml</packagingIncludes>
         <webResources>
            <resource>
              <directory>${basedir}/src</directory>
              <targetPath>WEB-INF</targetPath>
            </resource>
          </webResources>

          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
      <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>2.4</version>
      <configuration>
        <encoding>UTF-8</encoding>
      </configuration>
    </plugin>
    </plugins>

  </build>
  <dependencies>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-1.2-api</artifactId>
        <version>2.0-rc1</version>
    </dependency>

    <dependency>
        <groupId>org.kie.modules</groupId>
        <artifactId>org-apache-commons-lang3</artifactId>
        <version>6.1.0.CR1</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>1.7.7</version>
    </dependency>
<dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>2.3</version>
</dependency>
    <dependency>
        <groupId>org.apache.directory.studio</groupId>
        <artifactId>org.apache.commons.lang</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.5.4</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-asm</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-expression</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.0.1.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>net.sf.dozer</groupId>
    <artifactId>dozer</artifactId>
    <version>5.3.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb</artifactId>
        <version>1.6.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-kernel</artifactId>
        <version>1.6.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-local</artifactId>
    <version>1.6.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-transport-http</artifactId>
    <version>1.6.2</version>
    </dependency>
    <dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-api</artifactId>
    <version>1.2.13</version>
    </dependency>
    <dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-impl</artifactId>
    <version>1.2.13</version>
    </dependency>
    <dependency>
        <groupId>antlr</groupId>
        <artifactId>antlr</artifactId>
        <version>2.7.5</version>
    </dependency>
    <dependency>
        <groupId>aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>1.5.4</version>
    </dependency>
    <dependency>
    <groupId>org.apache.ws.schema</groupId>
    <artifactId>XmlSchema</artifactId>
    <version>1.4.5</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient-cache</artifactId>
        <version>4.2.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.2.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.2.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.2.3</version>
    </dependency>


  </dependencies>

  <version>1</version>
</project>

0 个答案:

没有答案