Maven构建受Eclipse .classpath文件的影响

时间:2013-01-05 05:42:41

标签: java maven classpath

Maven构建受Eclipse .classpath文件内容的影响。

我在.classpath中有2行,我不想让maven知道(src / old / java& src / test / manual)。

<!-- Disable these 2 lines below to see how project compiles with Maven on Jenkins-CI or locally      
-->
<classpathentry including="**/*.java" kind="src" output="target/old-classes" path="src/old/java"/>
<classpathentry excluding="**/.svn/" including="**/*.java" kind="src" output="target/test-classes" path="src/test/manual"/>

然而,maven正在接受这一点。并执行那些手动测试。当然失败了。

如何禁用此行为?

我使用Maven 3.0.4。 pom.xml的build部分在下面。

<build>
    <plugins>
        <plugin>
            <!-- <groupId>org.apache.maven.plugins</groupId>  -->
            <artifactId>maven-compiler-plugin</artifactId>
            <!-- <version>2.3.2</version>                 -->
            <configuration>
                <source>${java-version}</source>
                <target>${java-version}</target>
            </configuration>
        </plugin>

        <!-- http://maven.apache.org/plugins/maven-clean-plugin/examples/delete_additional_files.html 
        <plugin> RAW
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <filesets>
                    <fileset>
                        <directory>some/relative/path</directory>
                        <includes>
                            <include>**/*.tmp</include>
                            <include>**/*.log</include>
                        </includes>
                        <excludes>
                            <exclude>**/important.log</exclude>
                            <exclude>**/another-important.log</exclude>
                        </excludes>
                        <followSymlinks>false</followSymlinks>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>
        -->     

        <!-- http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <webResources>
                    <resource>
                        <!-- this is relative to the pom.xml directory -->
                        <directory>target/fun_base-1.0-SNAPSHOT</directory>
                        <excludes>
                            <exclude>**/*.jar</exclude>
                        </excludes>
                    </resource>
                </webResources>
            </configuration>
        </plugin>

        <!-- http://maven.apache.org/plugins/maven-war-plugin/examples/rapid-testing-jetty6-plugin.html -->
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>6.1.10</version>
            <configuration>
                <scanIntervalSeconds>10</scanIntervalSeconds>
                <connectors>
                    <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                        <port>8080</port>
                        <maxIdleTime>60000</maxIdleTime>
                    </connector>
                </connectors>
            </configuration>
        </plugin>

        <!-- http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <javadocVersion>${java-version}</javadocVersion>
                <source>${java-version}</source>
                <verbose>false</verbose>                    
            </configuration>
        </plugin>   

        <!-- http://maven.apache.org/plugins/maven-pmd-plugin/examples/targetJdk.html -->
        <plugin>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>2.7.1</version>
            <configuration>
                <targetJdk>${java-version}</targetJdk>
            </configuration>            
         </plugin>          

    </plugins>

</build>

<!-- http://maven.apache.org/plugins/maven-pmd-plugin/examples/targetJdk.html -->
<reporting>
    <plugins>
        <plugin>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>2.7.1</version>
            <configuration>
                <targetJdk>${java-version}</targetJdk>
            </configuration>
        </plugin>
    </plugins>
</reporting>    

Executed mojos

0 个答案:

没有答案