targetPath property ignored for webResources

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The plugin allows to specify additional webResources that should be treated if they were inside the src/main/webapp directory. Unfortunately the plugin ignores the targetPath property of the Resource model. For this reason, all webResources will added directly to the webappDirectory (default ${project.build.directory}/${project.build.finalName}) although they should be located in a relative sub-directory below src/main/webapp.

      Given the following example

      <build>
              <plugins>
                  <plugin>
                      <groupId>org.jenkins-ci.tools</groupId>
                      <artifactId>maven-hpi-plugin</artifactId>
                      <configuration>
                          <webResources>
                              <resource>
                                  <directory>some/dir</directory>
                                  <targetPath>dir-within-hpi</targetPath>
                                  <includes>
                                      <include>some-file</include>
                                  </includes>
                              </resource>
                          </webResources>
                      </configuration>
                  </plugin>
              </plugins>
      </build>
      

      Expected
      targetPath should be respected and be relative to webappDirectory.

      The result should be the same as if "some-file" had been found under "src/main/webapp/dir-within-hpi/some-file". Which would lead to the path "/dir-within-hpi/some-file" within the hpi file.

      Actual
      What actual happens is the same as if "some-file" had been been found under "src/main/webapp/some-file". Which would lead to the path "/some-file" within the hpi file.

            Assignee:
            Ronny Perinke
            Reporter:
            Ronny Perinke
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: