Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64408

targetPath property ignored for webResources

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-hpi-plugin
    • None
    • maven-hpi-plugin v3.17

      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.

            sephirothj Ronny Perinke
            sephirothj Ronny Perinke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: