Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-189

plugin not correctly interpolating POM variables like project.build.directory

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

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.1
    • 2.2-beta-2
    • None
    • None
    • I used both released version 2.1 and also 2.2-SNAPSHOT

    Description

      I have a assembly descriptor file with ${project.build.directory} in the <source> element of a <file>. I get an error "Failed to create assembly: File to filter not found" because the file path has "${project.build.directory}" rather than the value of ${project.build.directory}.

      I have traced the problem to AssemblyInterpolator.interpolateElementValue(). It tries to look up build.directory in ReflectionValueExtractor.evaluate() rather than project.build.directory, and it can't evaluate build.directory. A hack workaround is ...

      if (value == null)
      {
      try
      {
      value = ReflectionValueExtractor.evaluate(realExpr, project);
      if (value == null)
      {
      // HACK: strip ${ and } and retry
      wholeExpr = wholeExpr.substring(2, wholeExpr.length() - 1);
      value = ReflectionValueExtractor.evaluate(wholeExpr, project);
      }
      }

      Attachments

        Issue Links

        Activity

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

          People

            jdcasey John Dennis Casey
            raysuliteanu raysuliteanu
            Votes:
            7 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment