2014-04-01 2 views
0

maven 프로젝트를 설치할 때 통합 테스트 컴파일을 건너 뛰려면 어떻게해야합니까? -DskipITs 및 -DskipTests 만 찾았지만 컴파일이 아니라 실행 만 건너 뜁니다. 필요한 테스트 종속성을 제거하고 싶습니다. 그것이 안전 장치, 확실한 및 컴파일러 플러그인에 의해 허용되기 때문에maven 프로젝트의 통합 테스트 컴파일 건너 뛰기

<?xml version="1.0" encoding="UTF-8"?> 
<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>de.example.confluence</groupId> 
    <artifactId>qspaRest</artifactId> 
    <packaging>atlassian-plugin</packaging> 
    <name>qspaRest</name> 
    <version>3.0.4-SNAPSHOT</version> 
    <description>REST resources needed by the QSPA backend importer for 
* getting meta information from a space (name, description, homepage, permissions, ...)</description> 
    <build> 
    <sourceDirectory>/Users/example/git/qsparest/qsparest/src/main/java</sourceDirectory> 
    <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> 
    <testSourceDirectory>/Users/example/git/qsparest/qsparest/src/test/java</testSourceDirectory> 
    <outputDirectory>/Users/example/git/qsparest/qsparest/target/classes</outputDirectory> 
    <testOutputDirectory>/Users/example/git/qsparest/qsparest/target/test-classes</testOutputDirectory> 
    <resources> 
     <resource> 
     <directory>/Users/example/git/qsparest/qsparest/src/main/resources</directory> 
     </resource> 
    </resources> 
    <testResources> 
     <testResource> 
     <directory>/Users/example/git/qsparest/qsparest/src/test/resources</directory> 
     </testResource> 
    </testResources> 

    <directory>/Users/example/git/qsparest/qsparest/target</directory> 
<!-- <finalName>qspaRest-3.0.3-SNAPSHOT</finalName>--> 
    <pluginManagement> 
     <plugins> 
     <plugin> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.0.2</version> 
     </plugin> 

     <!-- For install:install-file--> 
<!-- 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-install-plugin</artifactId> 
     <executions> 
      <execution> 
      <phase>install</phase> 
      <goals> 
       <goal>install-file</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
--> 
     <plugin> 
      <artifactId>maven-antrun-plugin</artifactId> 
      <version>1.3</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-assembly-plugin</artifactId> 
      <version>2.2-beta-2</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-clean-plugin</artifactId> 
      <version>2.5</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.0</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-deploy-plugin</artifactId> 
      <version>2.4</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-ear-plugin</artifactId> 
      <version>2.3.1</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-ejb-plugin</artifactId> 
      <version>2.1</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-install-plugin</artifactId> 
      <version>2.2</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-jar-plugin</artifactId> 
      <version>2.2</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-javadoc-plugin</artifactId> 
      <version>2.5</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-plugin-plugin</artifactId> 
      <version>2.4.3</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-rar-plugin</artifactId> 
      <version>2.2</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-release-plugin</artifactId> 
      <version>2.0-beta-8</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-resources-plugin</artifactId> 
      <version>2.3</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-site-plugin</artifactId> 
      <version>2.0-beta-7</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-source-plugin</artifactId> 
      <version>2.0.4</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.4.3</version> 
     </plugin> 
     <plugin> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>2.1-alpha-2</version> 
     </plugin> 
     </plugins> 
    </pluginManagement> 
    <plugins> 
<plugin> 
    <artifactId>maven-clean-plugin</artifactId> 
    <configuration> 
     <excludeDefaultDirectories>true</excludeDefaultDirectories> 
     <filesets> 
      <!-- delete directories that will be generated when you 
       start the develpment server/client in eclipse 
      --> 
      <fileset> 
       <directory>target</directory> 
       <includes> 
        <include>**/*</include> 
       </includes> 
      </fileset> 
     </filesets> 
    </configuration> 
</plugin> 
     <plugin> 
     <groupId>com.atlassian.maven.plugins</groupId> 
     <artifactId>maven-confluence-plugin</artifactId> 
     <version>3.9</version> 
     <extensions>true</extensions> 
     <configuration> 
      <allowGoogleTracking>false</allowGoogleTracking> 
      <productVersion>${confluence.version}</productVersion> 
      <productDataVersion>3.5</productDataVersion> 
      <productDataPath>${basedir}/src/test/resources/generated-test-resources.zip</productDataPath> 
      <instructions /> 
     </configuration> 
     </plugin> 
     <plugin> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>2.0.2</version> 
     <configuration> 
      <source>1.6</source> 
      <target>1.6</target> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
    <repositories> 
    <repository> 
     <releases> 
     <checksumPolicy>warn</checksumPolicy> 
     </releases> 
     <snapshots> 
     <enabled>false</enabled> 
     <updatePolicy>daily</updatePolicy> 
     <checksumPolicy>warn</checksumPolicy> 
     </snapshots> 
     <id>atlassian-public</id> 
     <url>https://m2proxy.atlassian.com/repository/public</url> 
    </repository> 
    <repository> 
     <releases> 
     <checksumPolicy>warn</checksumPolicy> 
     </releases> 
     <snapshots> 
     <enabled>false</enabled> 
     </snapshots> 
     <id>atlassian-plugin-sdk</id> 
     <url>file:///Users/example/Desktop/atlassian-plugin-sdk-3.9/repository</url> 
    </repository> 
    <repository> 
     <snapshots> 
     <enabled>false</enabled> 
     </snapshots> 
     <id>central</id> 
     <name>Maven Repository Switchboard</name> 
     <url>http://repo1.maven.org/maven2</url> 
    </repository> 
    </repositories> 
    <pluginRepositories> 
    <pluginRepository> 
     <releases> 
     <checksumPolicy>warn</checksumPolicy> 
     </releases> 
     <snapshots> 
     <enabled>false</enabled> 
     <checksumPolicy>warn</checksumPolicy> 
     </snapshots> 
     <id>atlassian-public</id> 
     <url>https://m2proxy.atlassian.com/repository/public</url> 
    </pluginRepository> 
    <pluginRepository> 
     <releases> 
     <updatePolicy>never</updatePolicy> 
     </releases> 
     <snapshots> 
     <enabled>false</enabled> 
     </snapshots> 
     <id>central</id> 
     <name>Maven Plugin Repository</name> 
     <url>http://repo1.maven.org/maven2</url> 
    </pluginRepository> 
    </pluginRepositories> 
    <dependencies> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
     <version>1.6.4</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.6</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>net.sourceforge.jwebunit</groupId> 
     <artifactId>jwebunit-htmlunit-plugin</artifactId> 
     <version>2.2</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.atlassian.confluence.plugin</groupId> 
     <artifactId>func-test</artifactId> 
     <version>2.3</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.atlassian.confluence</groupId> 
     <artifactId>confluence</artifactId> 
     <version>${confluence.version}</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.wink</groupId> 
     <artifactId>wink-client</artifactId> 
     <version>1.1.3-incubating</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.mockito</groupId> 
     <artifactId>mockito-all</artifactId> 
     <version>1.8.5</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>javax.ws.rs</groupId> 
     <artifactId>jsr311-api</artifactId> 
     <version>1.0</version> 
     <scope>provided</scope> 
    </dependency> 

<!-- 
    <dependency> 
     <groupId>de.example</groupId> 
     <artifactId>qspaBackend</artifactId> 
     <version>3.0.3-SNAPSHOT</version> 
    </dependency> 
--> 
<!-- TODO: There is no separate confluence artifact, so we depend on the complete backend at the moment 
--> 
    <dependency> 
     <groupId>de.example</groupId> 
     <artifactId>qspaJiraModel</artifactId> 
     <version>3.0.3-SNAPSHOT</version> 
    </dependency> 
    <dependency> 
     <groupId>de.example</groupId> 
     <artifactId>qspaConfluenceModel</artifactId> 
     <version>3.0.4-SNAPSHOT</version> 
    </dependency> 
<!-- 
--> 
    </dependencies> 
    <reporting> 
    <outputDirectory>/Users/example/git/qsparest/qsparest/target/site</outputDirectory> 
    </reporting> 
    <properties> 
    <amps.version>3.9</amps.version> 
    <downloadSources>true</downloadSources> 
    <confluence.data.version>3.5</confluence.data.version> 
    <downloadJavadocs>true</downloadJavadocs> 
    <confluence.version>4.1.4</confluence.version> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <skipTests>true</skipTests> 

    <!-- Settings for install:install-file--> 
    <groupId>${project.groupId}</groupId> 
    <artifactId>${project.artifactId}</artifactId> 
    <version>${project.version}</version> 
    <packaging>${project.packaging}</packaging> 
    <file>${project.build.directory}/${project.build.finalName}.jar</file> 
    </properties> 
</project> 
+1

[빌드에서 {테스트} 범위가 지정된 종속성을 제외하는 방법] (http://stackoverflow.com/questions/22609534/how-to-exclude-test-scoped-dependencies-from-build) – blackbuild

답변

2

속성 -Dmaven.test.skip=true 모든 테스트 및 모든 테스트 컴파일을 건너 뜁니다. -DskipTests과 같은 다른 모든 속성은 테스트 실행을 건너 뛰지 만 파일은 여전히 ​​컴파일됩니다.

관련 문제