Uploaded image for project: 'Maven Plugin Tools'
  1. Maven Plugin Tools
  2. MPLUGIN-58

File Parameter Evaluation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4
    • None
    • None

    Description

      I am developping a plugin have as configuration a File.

      In the Test phasis, I encounter some trouble with File Resolution.
      My dependency are :

      • org.apache.maven.shared:maven-plugin-testing-harness:1.1

      In the org.codehaus.plexus.component.configurator.converters.basic.FileConverter provided by Plexus-container-default-1.0-alpha-9-stable-1.jar,
      The method fromConfiguration() calls expressionEvaluator.alignToBaseDirectory( f );
      In case of Test , the expressionEvaluator is org.apache.maven.plugin.testing.ResolverExpressionEvaluatorStub.
      The code is as follow :
      public File alignToBaseDirectory( File file )
      {
      if ( file.getAbsolutePath().startsWith( PlexusTestCase.getBasedir() ) )

      { return file; }

      else

      { return new File( PlexusTestCase.getBasedir() + File.pathSeparator + file.getPath() ); }

      }

      Two Bugs :

      • All path which do not start with TestCase Basedir are assumed as relative path based on basedir. Why not, but it not allow to test Absolute path.
      • The concatenation with the Basedir is done with File.pathSeparator ( : under UNIX and ; under Windows) instead of File.separator ( / under Unix and \ under Windows ).

      Attachments

        1. align-to-base-birectory.patch
          0.7 kB
          Benjamin Bentmann

        Activity

          People

            siveton Siveton Vincent
            kaamelot.fr Vincent Thoulé
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: