Maven WAR Plugin
  1. Maven WAR Plugin
  2. MWAR-54

add targetPath support on the webResources plugin parameter

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.2
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      1

      Issue Links

        Activity

        Hide
        Jay Goldman added a comment -

        Actually, there are really 2 problems,

        • this one - which I think should be reopened.
        • And, I think there is also a problem with the way the 'src/main/resources' directory is handled.
          The on-line doc for the plugin says that 'src/main/resources' files will be copied to the target/classes and WEB-INF/classes but they are not, they are instaed copied to the WEB-INF directory. You can try to work around this by specifying the targetPath ... but, of course, that fails due to the underlying problem with targetPath (MWAR-54). Do you want me to open up another problem, i.e., that src/main/resource files are not copied where the doc says they are? This 'bug' could be 'fixed' by changing the doc

        WRT MWAR-54:
        The changes that marvin made to 'fix' the problem were definitely required - but they were not sufficient to correct the problem, at least when doing a clean build on a windows xp system.
        (note - there are additional fixes that should be made to the logging messages to accurately reflect what is going on - but i don't think there is anything incorrect about the code in the plugin inself)

        I think the underlying problem is the behavior of the copyFileIfModified method.
        I have not had the time to setup my machine to build maven (I was able to easily build a modified version of the plugin ... maven happily loaded up my machine will all the necessary pieces) - so I have not looked at this code.

        Show
        Jay Goldman added a comment - Actually, there are really 2 problems, this one - which I think should be reopened. And, I think there is also a problem with the way the 'src/main/resources' directory is handled. The on-line doc for the plugin says that 'src/main/resources' files will be copied to the target/classes and WEB-INF/classes but they are not, they are instaed copied to the WEB-INF directory. You can try to work around this by specifying the targetPath ... but, of course, that fails due to the underlying problem with targetPath ( MWAR-54 ). Do you want me to open up another problem, i.e., that src/main/resource files are not copied where the doc says they are? This 'bug' could be 'fixed' by changing the doc WRT MWAR-54 : The changes that marvin made to 'fix' the problem were definitely required - but they were not sufficient to correct the problem, at least when doing a clean build on a windows xp system. (note - there are additional fixes that should be made to the logging messages to accurately reflect what is going on - but i don't think there is anything incorrect about the code in the plugin inself) I think the underlying problem is the behavior of the copyFileIfModified method. I have not had the time to setup my machine to build maven (I was able to easily build a modified version of the plugin ... maven happily loaded up my machine will all the necessary pieces) - so I have not looked at this code.
        Hide
        Mark Lynde added a comment -

        Still not working in v 2.0.7.. The <targetPath> element is ignored and everything gets copied to the root of the webappDirectory. Can an admin please reopen this issue.

        Show
        Mark Lynde added a comment - Still not working in v 2.0.7.. The <targetPath> element is ignored and everything gets copied to the root of the webappDirectory. Can an admin please reopen this issue.
        Hide
        Eric Zhi Li added a comment -

        <targetPath> still not working in 2.0.8, please help. thanks a lot

        Show
        Eric Zhi Li added a comment - <targetPath> still not working in 2.0.8, please help. thanks a lot
        Hide
        Olivier Lamy added a comment -

        Have you try with last SNAPSHOT ?
        If it fail with it can you provide a simple project to reproduce the issue ?
        Thanks.

        Show
        Olivier Lamy added a comment - Have you try with last SNAPSHOT ? If it fail with it can you provide a simple project to reproduce the issue ? Thanks.
        Hide
        Brian Weiner added a comment -

        Everyone is having the same problem I was having. The fix is in 2.0.2 of the plugin, not maven. So specify the version like so:

        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.0.2</version>

        and It'll work fine.

        Show
        Brian Weiner added a comment - Everyone is having the same problem I was having. The fix is in 2.0.2 of the plugin, not maven. So specify the version like so: <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.0.2</version> and It'll work fine.

          People

          • Assignee:
            Marvin King
            Reporter:
            Marvin King
          • Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 30 minutes
              30m