2010-10-20 71 views
7

它不發生的事情,但有時我覺得像這樣的東西:爲什麼行家複製顛覆目錄爲目標

>dir /SF target\.svn 
…\target\Zeiterfassung-web\WEB-INF\.svn\. 
…\target\Zeiterfassung-web\WEB-INF\.svn\.. 
…\target\Zeiterfassung-web\WEB-INF\.svn\lock 

這怎麼可能發生的Maven作爲應該忽略默認.svn目錄?

我可以明確排除它們嗎(注意WEB-INF--它既不是源也不是資源)?

還是可以將血腥的.svn數據放在別的地方與工作文件分開(像clearcase那樣)?


的POM的要求(負SCM和問題管理):

<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' 
> 
<!-- Projekt - - - - - - - - - - - - - - - - - - - - - - - - {{{1 - - - --> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
    <artifactId>Zeiterfassung</artifactId> 
    <groupId>com.noser</groupId> 
    <version>1.0-SNAPSHOT</version> 
    <relativePath>../Zeiterfassung</relativePath> 
    </parent> 
    <groupId>com.noser</groupId> 
    <artifactId>Zeiterfassung-web</artifactId> 
    <packaging>war</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>Zeiterfassung Webapp</name> 
    <description>Mobile Applikation Zeiterfassung — Web Archive/Application</description> 
    <url>http://maven.apache.org</url> 
    <repositories> 
    <repository> 
     <id>java.net2</id> 
     <name>Repository hosting the jee6 artifacts</name> 
     <url>http://download.java.net/maven/2</url> 
    </repository> 
    </repositories> 
    <dependencies> 
    <dependency> 
     <groupId>${project.groupId}</groupId> 
     <artifactId>Zeiterfassung-lib</artifactId> 
     <version>${project.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>javax</groupId> 
     <artifactId>javaee-web-api</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.scala-lang</groupId> 
     <artifactId>scala-library</artifactId> 
     <version>2.8.0</version> 
     <type>jar</type> 
     <scope>compile</scope> 
    </dependency> 
    </dependencies> 
    <organization> 
    <name>Noser Engineering AG</name> 
    <url>http://www.noser.com</url> 
    </organization> 
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - }}}1 - - - --> 
<!-- Build - - - - - - - - - - - - - - - - - - - - - - - - - {{{1 - - - --> 
    <build> 
    <defaultGoal>package</defaultGoal> 
    <resources> 
     <resource> 
     <directory>src/main/resources</directory> 
     <excludes> 
      <exclude>**/.backups/*</exclude> 
      <exclude>**/.backups</exclude> 
      <exclude>**/.svn/*</exclude> 
      <exclude>**/.svn</exclude> 
     </excludes> 
     </resource> 
    </resources> 
    <plugins> 
     <plugin> 
     <groupId>org.scala-tools</groupId> 
     <artifactId>maven-scala-plugin</artifactId> 
     <executions> 
      <execution> 
      <goals> 
       <goal>compile</goal> 
       <goal>testCompile</goal> 
      </goals> 
      </execution> 
     </executions> 
     <configuration> 
      <jvmArgs> 
      <jvmArg>-Xms64m</jvmArg> 
      <jvmArg>-Xmx1024m</jvmArg> 
      </jvmArgs> 
     </configuration> 
     </plugin> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <configuration> 
      <source>1.6</source> 
      <target>1.6</target> 
      <encoding>${project.build.sourceEncoding}</encoding> 
      <showDeprecation>true</showDeprecation> 
     </configuration> 
     </plugin> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-war-plugin</artifactId> 
     <configuration> 
      <failOnMissingWebXml>false</failOnMissingWebXml> 
     </configuration> 
     </plugin> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-resources-plugin</artifactId> 
     <configuration> 
      <encoding>${project.build.sourceEncoding}</encoding> 
     </configuration> 
     </plugin> 
    </plugins> 
    <finalName>Zeiterfassung-web</finalName> 
    </build> 
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - }}}1 - - - --> 
<!-- Profiles - - - - - - - - - - - - - - - - - - - - - - - {{{1 - - - --> 
    <profiles> 
    <profile> 
     <id>endorsed</id> 
     <activation> 
     <property> 
      <name>sun.boot.class.path</name> 
     </property> 
     </activation> 
     <build> 
     <plugins> 
      <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
       <encoding>${project.build.sourceEncoding}</encoding> 
       <showDeprecation>true</showDeprecation> 
       <compilerArguments> 
       <bootclasspath>${settings.localRepository}/javax/javaee-endorsed-api/6.0/javaee-endorsed-api-6.0.jar${path.separator}${sun.boot.class.path}</bootclasspath> 
       </compilerArguments> 
      </configuration> 
      <dependencies> 
       <dependency> 
       <groupId>javax</groupId> 
       <artifactId>javaee-endorsed-api</artifactId> 
       <version>6.0</version> 
       </dependency> 
      </dependencies> 
      </plugin> 
     </plugins> 
     </build> 
    </profile> 
    </profiles> 
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - }}}1 - - - --> 
<!-- Reporting - - - - - - - - - - - - - - - - - - - - - - - {{{1 - - - --> 
    <reporting> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-javadoc-plugin</artifactId> 
     <configuration> 
      <show>private</show> 
      <nohelp>true</nohelp> 
     </configuration> 
     </plugin> 
    </plugins> 
    </reporting> 
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - }}}1 - - - --> 
<!-- Properties - - - - - - - - - - - - - - - - - - - - - - {{{1 - - - --> 
    <properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <maven.compile.encoding>UTF-8</maven.compile.encoding> 
    <netbeans.hint.deploy.server>gfv3ee6wc</netbeans.hint.deploy.server> 
    </properties> 
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - }}}1 - - - --> 
</project> 
<!-- vim: set nowrap tabstop=8 shiftwidth=2 softtabstop=2 expandtab :--> 
<!-- vim: set textwidth=0 filetype=xml foldmethod=marker spell spelllang=en_gb :--> 
+0

我得到了同樣的結果,除了在target \ classes和target \ test-classes中,但是對於多模塊項目的一些部分,一些戰爭和一些jar。在Windows上使用eclipse。 – 2011-02-21 21:04:20

+0

我也時常使用Eclipse。但這些日子大多是Netbeans。想到這個問題:這個問題也不太常見。我想知道是否有相關性。也許是Eclipse問題。 – Martin 2011-02-22 10:37:11

回答

1

我對你在戰爭中獲得.svn目錄感到非常驚訝(據我所知,默認排除scm目錄,排除在源代碼中被硬編碼)。我真的不知道你爲什麼得到他們。

這就是說,下面可能有助於解決此問題:

... 
<plugins> 
    <plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-war-plugin</artifactId> 
    <configuration> 
     <warSourceExcludes> 
     **/.svn/** 
     </warSourceExcludes> 
    </configuration> 
    </plugin> 
    ... 
</plugins> 

但正如我所說,我認爲上面的更象是一個解決辦法比的解決方案。

+0

正如我所說它是零星的,所以我想這是一種錯誤。但感謝後面的排除。 – Martin 2010-10-20 19:22:33

0

它最有可能的,如果你使用maven-release-plugin發生。如果它困擾你只是運行mvn clean並完成它。

+0

'mvn clean'確實是我目前的解決方案。我正在尋找更好的解決方案。或者它發生的原因,我可以避免這種情況,或知道當我做X時,我需要一個乾淨的後來。 – Martin 2010-10-20 09:04:34

+0

你使用'maven-release-plugin'嗎? – 2010-10-20 09:10:15

+0

其實否: - > ffind/SVT「maven-release-plugin」* .pom - 0 Zeilen in 0 Dateien – Martin 2010-10-20 11:15:20