Turn off the inclusion of pom build resources by default.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116153 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
ac4c80304a
commit
cdc0b6da87
5 files changed
+46
-5
No files matched your search
@@ -57,14 +57,25 @@
|
||||
<classpathentry kind="src" path="${srcDir}" excluding="${excluding}" />
|
||||
|
||||
<j:if test="${!pom.build.resources.isEmpty()}">
|
||||
<!-- Turn off for most users this buggy code-->
|
||||
<j:if test="${maven.eclipse.addResources == 'true'}">
|
||||
<j:forEach var="resource" items="${pom.build.resources}">
|
||||
<j:set var="includingAsString" value="" />
|
||||
<j:forEach var="res" items="${resource.includes}">
|
||||
<j:set var="includingAsString" value="${includingAsString}${res}|" />
|
||||
</j:forEach>
|
||||
<j:set var="excludingAsString" value="" />
|
||||
<j:forEach var="res" items="${resource.excludes}">
|
||||
<j:set var="excludingAsString" value="${excludingAsString}${res}|" />
|
||||
</j:forEach>
|
||||
<maven:makeRelativePath var="resourceDirectory" basedir="${basedir}" path="${resource.directory}" separator="/"/>
|
||||
<!-- don't add duplicate directories -->
|
||||
<j:if test="${!resourceDirectory.equals(srcDir)}">
|
||||
<classpathentry kind="src" path="${resourceDirectory}" including="${include}" excluding="${exclude}" />
|
||||
<classpathentry kind="src" path="${resourceDirectory}" including="${includingAsString}" excluding="${excludingAsString}" />
|
||||
</j:if>
|
||||
</j:forEach>
|
||||
</j:if>
|
||||
</j:if>
|
||||
</j:if>
|
||||
|
||||
<!-- Add the list of additional directories for the classpath from ${maven.eclipse.classpath.include}-->
|
||||
@@ -127,14 +138,25 @@
|
||||
|
||||
<j:if test="${pom.build.unitTest != null}">
|
||||
<j:if test="${!pom.build.unitTest.resources.isEmpty()}">
|
||||
<!-- Turn off for most users this buggy code-->
|
||||
<j:if test="${maven.eclipse.addResources == 'true'}">
|
||||
<j:forEach var="resource" items="${pom.build.unitTest.resources}">
|
||||
<j:set var="includingAsString" value="" />
|
||||
<j:forEach var="res" items="${resource.includes}">
|
||||
<j:set var="includingAsString" value="${includingAsString}${res}|" />
|
||||
</j:forEach>
|
||||
<j:set var="excludingAsString" value="" />
|
||||
<j:forEach var="res" items="${resource.excludes}">
|
||||
<j:set var="excludingAsString" value="${excludingAsString}${res}|" />
|
||||
</j:forEach>
|
||||
<maven:makeRelativePath var="resourceDirectory" basedir="${basedir}" path="${resource.directory}" separator="/"/>
|
||||
<!-- don't add duplicate directories -->
|
||||
<j:if test="${!resourceDirectory.equals(testSrcDir)}">
|
||||
<classpathentry kind="src" path="${resourceDirectory}" output="${testOutputDir}" />
|
||||
<classpathentry kind="src" path="${resourceDirectory}" output="${testOutputDir}" including="${includingAsString}" excluding="${excludingAsString}"/>
|
||||
</j:if>
|
||||
</j:forEach>
|
||||
</j:if>
|
||||
</j:if>
|
||||
</j:if>
|
||||
</j:if>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
xmlns:u="jelly:util"
|
||||
xmlns:x="jelly:xml">
|
||||
|
||||
<goal name="testPlugin" prereqs="test-eclipse,test-natures,test-builders,test-natures-and-builders,test-classpath-has-generated-source,test-classpath-has-overridden-jar,test-noduplicates,test-classpath-con-entry">
|
||||
<goal name="testPlugin" prereqs="test-eclipse,test-natures,test-builders,test-natures-and-builders,test-classpath-has-generated-source,test-classpath-has-overridden-jar,test-noduplicates,test-classpath-con-entry,test-maven-eclipse-addResources">
|
||||
</goal>
|
||||
|
||||
<goal name="test-init">
|
||||
@@ -111,7 +111,7 @@
|
||||
<u:file var="classpathFile" name="${dotClasspath}"/>
|
||||
<x:parse var="classpathDoc" xml="${classpathFile.toURL()}" />
|
||||
<x:set var="count" select="count($classpathDoc/classpath/classpathentry[contains(@kind,'src')])"/>
|
||||
<assert:assertEquals expected="6" value="${count.intValue().toString()}" msg="Wrong number of generated src directories found"/>
|
||||
<assert:assertEquals expected="4" value="${count.intValue().toString()}" msg="Wrong number of generated src directories found"/>
|
||||
|
||||
</goal>
|
||||
|
||||
@@ -154,5 +154,21 @@
|
||||
<x:set var="countConEntries" select="count($classpathDoc/classpath/classpathentry[contains(@kind,'con')])"/>
|
||||
<assert:assertEquals expected="2" value="${countConEntries.intValue().toString()}" msg="Classpath entry kind='con' should be added twice, once mandatory, other variable"/>
|
||||
</goal>
|
||||
|
||||
<goal name="test-maven-eclipse-addResources">
|
||||
<attainGoal name="test-init"/>
|
||||
<!-- Not working! ARgh-->
|
||||
<j:set var="maven.eclipse.addResources" value="true"/>
|
||||
<attainGoal name="eclipse"/>
|
||||
|
||||
<assert:assertFileExists file="${dotProject}" />
|
||||
<assert:assertFileExists file="${dotClasspath}" />
|
||||
|
||||
<u:file var="classpathFile" name="${dotClasspath}"/>
|
||||
<x:parse var="classpathDoc" xml="${classpathFile.toURL()}" />
|
||||
<x:set var="count" select="count($classpathDoc/classpath/classpathentry[contains(@kind,'src')])"/>
|
||||
<assert:assertEquals expected="4" value="${count.intValue().toString()}" msg="Wrong number of generated src directories found"/>
|
||||
|
||||
</goal>
|
||||
|
||||
</project>
|
||||
Reference in new issue
Block a user