Author: brianf Date: Sat Jul 7 19:30:05 2007 New Revision: 554297 URL: http://svn.apache.org/viewvc?view=rev&rev=554297 Log: applied patch for MECLIPSE-165
Added: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.classpath maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.project maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/pom.xml maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/binary-resources/ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/binary-resources/dummy maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/resources/ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/resources/dummy Modified: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java Modified: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java?view=diff&rev=554297&r1=554296&r2=554297 ============================================================================== --- maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java (original) +++ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java Sat Jul 7 19:30:05 2007 @@ -345,6 +345,16 @@ private String projectNameTemplate; /** + * When set to true, resource directories which are marked as filtered will + * not be added to eclipse's source directories. They will therefore not be + * included in the classpath from eclipse's point of view. For example, they + * will not be accessible from unit tests when ran from eclipse. + * + * @parameter expression="{$eclipse.excludeFilteredResources}" default-value="false" + */ + private boolean excludeFilteredResourcesFromSourceDirs; + + /** * Parsed wtp version. */ private float wtpVersionFloat; @@ -1073,6 +1083,11 @@ String includePattern = null; String excludePattern = null; + + if( resource.isFiltering() && excludeFilteredResourcesFromSourceDirs ) { + getLog().debug( Messages.getString( "EclipseClasspathWriter.filteredresourcedirexcludedfromsourcedirs", resource.getDirectory() ) ); //$NON-NLS-1$ + continue; + } if ( resource.getIncludes().size() != 0 ) { Modified: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties?view=diff&rev=554297&r1=554296&r2=554297 ============================================================================== --- maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties (original) +++ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/main/resources/org/apache/maven/plugin/eclipse/messages.properties Sat Jul 7 19:30:05 2007 @@ -28,7 +28,8 @@ EclipseClasspathWriter.lookingforsources=Looking for source archive for artifact {0} EclipseClasspathWriter.sourcesavailable=Sources attachment for artifact {0} set to {1} - +EclipseClasspathWriter.filteredresourcedirexcludedfromsourcedirs=Resource directory {0} is excluded from sources directories because it is filtered + EclipseProjectWriter.notafile=Not adding a file link to {0}; it is not a file EclipseCleanMojo.failedtodelete=Failed to delete {0} file: {0} @@ -40,4 +41,4 @@ IdeDependency.cantreadfile=Unable to read file: {0} -Rad6LibCopier.cantdeletefile=Failed to delete file: {0} \ No newline at end of file +Rad6LibCopier.cantdeletefile=Failed to delete file: {0} Modified: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java?view=diff&rev=554297&r1=554296&r2=554297 ============================================================================== --- maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java (original) +++ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/java/org/apache/maven/plugin/eclipse/EclipsePluginTest.java Sat Jul 7 19:30:05 2007 @@ -34,313 +34,7 @@ { super.setUp(); } - public void testProject01() throws Exception - { - testProject( "project-01" ); - } - public void testProject02() throws Exception - { - testProject( "project-02" ); - } - - public void testProject03() throws Exception - { - testProject( "project-03" ); - } - - public void testProject04() throws Exception - { - testProject( "project-04" ); - } - - public void testProject05() throws Exception - { - testProject( "project-05" ); - } - - public void testProject06() throws Exception - { - testProject( "project-06" ); - } - - // @TODO temporarily disabled, since it randomly fails due to a different order for dependencies in classpath and - // wtpmodules. This is not a problem, since order could be ignored in this test, but we should rewrite the - // file-comparing - // step which at the moment just does line by line comparison - // public void testProject07() - // throws Exception - // { - // testProject( "project-07" ); - // } - - public void testProject08() throws Exception - { - testProject( "project-08" ); - } - - /** - * Tests with <code>outputDirectory</code> and <code>outputDir</code> - * - * @throws Exception - */ - public void testProject09() throws Exception - { - testProject( "project-09" ); - } - - public void testProject10() throws Exception - { - testProject( "project-10" ); - } - - public void testProject11() throws Exception - { - testProject( "project-11" ); - } - - /** - * Ear packaging - * - * @throws Exception - * any exception thrown during test - */ - public void testProject12() throws Exception - { - testProject( "project-12" ); - } - - /** - * Dependency range - MECLIPSE-96 - * - * @throws Exception - * any exception thrown during test - */ - public void testProject13() throws Exception - { - testProject( "project-13" ); - } - - /** - * Additional natures and builders - MECLIPSE-64 - * - * @throws Exception - * any exception thrown during test - */ - public void testProject14() throws Exception - { - testProject( "project-14" ); - } - - /** - * <code>outputDirectory</code> parameter - MECLIPSE-11 - * - * @throws Exception - * any exception thrown during test - */ - public void testProject15() throws Exception - { - Properties props = new Properties(); - props.put( "outputDirectory", "bin" ); - testProject( "project-15", props, "clean", "eclipse" ); - } - - // Commented out: failing due to MNG-2025 - // /** - // * UTF8 encoding - MECLIPSE-56 - // * @throws Exception any exception thrown during test - // */ - // public void testProject16() - // throws Exception - // { - // testProject( "project-16" ); - // } - - // Commented out: failing on Continuum, due to MNG-2025 too? - // /** - // * ISO-8859-15 encoding - MECLIPSE-56 - // * @throws Exception any exception thrown during test - // */ - // public void testProject17() - // throws Exception - // { - // testProject( "project-17" ); - // } - - /** - * relative location of system dependencies - MECLIPSE-89 - * - * @throws Exception - * any exception thrown during test - */ - public void testProject18() throws Exception - { - testProject( "project-18" ); - } - - /** - * Resource targetPath is relative to the project's output directory - MECLIPSE-77 - * - * @throws Exception - * any exception thrown during test - */ - public void testProject19() throws Exception - { - testProject( "project-19" ); - } - - /** - * WTP 1.5 changes in wtpmodules. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject20() throws Exception - { - testProject( "project-20" ); - } - - /** - * PDE support. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject21() throws Exception - { - testProject( "project-21" ); - } - - /** - * PDE support using eclipse-plugin packaging. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject22() throws Exception - { - testProject( "project-22" ); - } - - /** - * Additional config files using "additionalConfig" property. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject23() throws Exception - { - testProject( "project-23" ); - } - - /** - * Test rewriting of OSGI manifest files. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject24() throws Exception - { - testProject( "project-24" ); - } - - /** - * Test source exclude/include. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject25() throws Exception - { - testProject( "project-25" ); - } - - /** - * Test different compiler settings for test sources. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject26() throws Exception - { - testProject( "project-26" ); - } - - /** - * Test additional project facets specified. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject27() throws Exception - { - testProject( "project-27" ); - } - - /** - * MECLIPSE-241 : Compiler settings from parent project aren't used in wtp facet. - * - * @throws Exception - * any exception thrown during test - */ - public void testProject28() throws Exception - { - testProject( "project-28/module-1" ); - } - - /** - * MECLIPSE-198 : EJB version is not resloved - * - * @throws Exception - * any exception thrown during test - */ - public void testProject29() throws Exception - { - testProject( "project-29" ); - } - - /** - * MECLIPSE-108 : .wtpmodules with version 2.4 for javax.servlet:servlet-api:2.3 - * - * @throws Exception - * any exception thrown during test - */ - public void testProject30() throws Exception - { - testProject( "project-30" ); - } - - /** - * MECLIPSE-185 : plugin doesn't fail when dependencies are missing - * - * @throws Exception - * any exception thrown during test - */ - public void testProject31() throws Exception - { - try - { - testProject( "project-31" ); - - //disabling this test for now. See comments in MECLIPSE-185 - Bfox - // fail("Expected to receive a MojoExecutionException"); - } - catch (MojoExecutionException e) - { - //expected exception here - } - } - - /** - * MECLIPSE-109 : .component wb-resource source path incorrect for ear packaging - * - * @throws Exception - * any exception thrown during test - */ - public void testProject32() throws Exception - { - testProject( "project-32" ); - } /** @@ -364,6 +58,11 @@ * path. This means that the expected .classpath can't match the final result as the result will * have the absolute path to the user's local repo. */ - - + /** + * MECLIPSE-165: Ability to exclude filtered resources from eclipse's source directories + */ + public void testProject34() throws Exception + { + testProject( "project-34" ); + } } Added: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.classpath URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.classpath?view=auto&rev=554297 ============================================================================== --- maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.classpath (added) +++ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.classpath Sat Jul 7 19:30:05 2007 @@ -0,0 +1,5 @@ +<classpath> + <classpathentry kind="src" path="src/main/binary-resources"/> + <classpathentry kind="output" path="target/classes"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> +</classpath> Added: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.project URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.project?view=auto&rev=554297 ============================================================================== --- maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.project (added) +++ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/expected/.project Sat Jul 7 19:30:05 2007 @@ -0,0 +1,14 @@ +<projectDescription> + <name>maven-eclipse-plugin-test-project-34</name> + <comment/> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments/> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/pom.xml?view=auto&rev=554297 ============================================================================== --- maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/pom.xml (added) +++ maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/pom.xml Sat Jul 7 19:30:05 2007 @@ -0,0 +1,30 @@ +<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>eclipse</groupId> + <artifactId>maven-eclipse-plugin-test-project-34</artifactId> + <version>34</version> + <name>maven-eclipse-plugin-test-project-34</name> + <build> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + <resource> + <directory>src/main/binary-resources</directory> + <filtering>false</filtering> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-eclipse-plugin</artifactId> + <version>test</version> + <configuration> + <excludeFilteredResourcesFromSourceDirs>true</excludeFilteredResourcesFromSourceDirs> + </configuration> + </plugin> + </plugins> + </build> +</project> Added: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/binary-resources/dummy URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/binary-resources/dummy?view=auto&rev=554297 ============================================================================== (empty) Added: maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/resources/dummy URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-eclipse-plugin-MECLIPSE-165/src/test/resources/projects/project-34/src/main/resources/dummy?view=auto&rev=554297 ============================================================================== (empty)