Uploaded image for project: 'Maven Resources Plugin'
  1. Maven Resources Plugin
  2. MRESOURCES-87

Test resource doesn't override main resource

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.3
    • None
    • copy
    • None
    • Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
      Java version: 1.6.0_07

    Description

      I have two files:

      src/main/resources/resource.xml
      src/test/resources/resource.xml

      and following block in the pom.xml:

      <build>
        <resources>
          <resource>
            <directory>src/main/resources</directory>
          </resource>
        </resources>
      </build>
      <profiles>
        <profile>
          <id>test</id>
          <build>
            <resources>
              <resource>
                <directory>src/test/resources</directory>
              </resource>
            </resources>
          </build>
        </profile>
      </profiles>
      

      When I run mvn clean package, I want the file from src/main/resources to be packaged. When I run mvn clean package -P test, I want the file from src/test/resources to be packaged. Unfortunately, that doesn't happen. However, when I add filtering to profiled resource:

      <profile>
        <build>
          <resources>
            <resource>
              <directory>src/test/resources</directory>
              <filtering>true</filtering>
            </resource>
          </resources>
        </build>
      </profile>
      

      it works. So two questions:

      • is it a bug that overriding strategy is triggered by filtering tag?
      • if so, which behavior is correct: always override resource or never?

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            ndpar Andrey Paramonov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment