Maven Shared Components
  1. Maven Shared Components
  2. MSHARED-92

Cannot retreive FileNameMapper with MapperUtil

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: file-management-1.2.1
    • Fix Version/s: file-management-1.2.2
    • Component/s: file-management
    • Labels:
      None
    • Environment:
      any
    • Flags:
      Patch

      Description

      I'm trying to use file name mappers inside a maven plugin with the file-management shared project.

      I've added a fileset definition in the plugin's configuration as follow :

                <plugin>
                  <groupId>info.flex-mojos</groupId>
                  <artifactId>flex-compiler-mojo</artifactId>
                  <extensions>true</extensions>
                  <version>2.0M11-SNAPSHOT</version>
                  <configuration>
                    <includeSources>
                          <param>${basedir}/src</param>
                      </includeSources>
                    <targetPlayer>9.0.28</targetPlayer>
                    <fileset>
                      <directory>${basedir}/src</directory>
                      <includes>
                        <include>**/*.mxml</include>
                      </includes>
                      <mapper>
                          <type>flatten</type>
                      </mapper>
                    </fileset>
                  </configuration>
                </plugin>

      Unfortunately, I get a NPE while trying to retrieve my mapper :

      java.lang.NullPointerException
              at org.apache.maven.shared.model.fileset.mappers.MapperUtil.getFileNameMapper(MapperUtil.java:114)
              at info.rvin.mojo.flexmojo.compiler.ApplicationMojo.setUp(ApplicationMojo.java:194)
              at info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:178)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

      I've checked current trunk on shared/file-management, it seems that the "initializeBuiltIns" call should initialize implementations but it does not.

      I have enclosed a trivial patch which should fix this.

      1. file-management.patch
        5 kB
        jérôme creignou

        Activity

        jérôme creignou created issue -
        Petar Tahchiev made changes -
        Field Original Value New Value
        Assignee Petar Tahchiev [ paranoiabla ]
        Petar Tahchiev made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Petar Tahchiev made changes -
        Status In Progress [ 3 ] Open [ 1 ]
        Hide
        Petar Tahchiev added a comment -

        The patch is applied in the trunk. Once again thanks.

        Show
        Petar Tahchiev added a comment - The patch is applied in the trunk. Once again thanks.
        Petar Tahchiev made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s fiile-managment 1.2.2 [ 14970 ]
        Hervé Boutemy made changes -
        Description I'm trying to use file name mappers inside a maven plugin with the file-management shared project.

        I've added a fileset definition in the plugin's configuration as follow :
                  <plugin>
                    <groupId>info.flex-mojos</groupId>
                    <artifactId>flex-compiler-mojo</artifactId>
                    <extensions>true</extensions>
                    <version>2.0M11-SNAPSHOT</version>
                    <configuration>
                      <includeSources>
                            <param>${basedir}/src</param>
                        </includeSources>
                      <targetPlayer>9.0.28</targetPlayer>
                      <fileset>
                        <directory>${basedir}/src</directory>
                        <includes>
                          <include>**/*.mxml</include>
                        </includes>
                        <mapper>
                            <type>flatten</type>
                        </mapper>
                      </fileset>
                    </configuration>
                  </plugin>

        Unfortunately, I get a NPE while trying to retrieve my mapper :

        java.lang.NullPointerException
                at org.apache.maven.shared.model.fileset.mappers.MapperUtil.getFileNameMapper(MapperUtil.java:114)
                at info.rvin.mojo.flexmojo.compiler.ApplicationMojo.setUp(ApplicationMojo.java:194)
                at info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:178)
                at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
                at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
                at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

        I've checked current trunk on shared/file-management, it seems that the "initializeBuiltIns" call should initialize implementations but it does not.

        I have enclosed a trivial patch which should fix this.
        I'm trying to use file name mappers inside a maven plugin with the file-management shared project.

        I've added a fileset definition in the plugin's configuration as follow :
        {code:xml} <plugin>
                    <groupId>info.flex-mojos</groupId>
                    <artifactId>flex-compiler-mojo</artifactId>
                    <extensions>true</extensions>
                    <version>2.0M11-SNAPSHOT</version>
                    <configuration>
                      <includeSources>
                            <param>${basedir}/src</param>
                        </includeSources>
                      <targetPlayer>9.0.28</targetPlayer>
                      <fileset>
                        <directory>${basedir}/src</directory>
                        <includes>
                          <include>**/*.mxml</include>
                        </includes>
                        <mapper>
                            <type>flatten</type>
                        </mapper>
                      </fileset>
                    </configuration>
                  </plugin>{code}

        Unfortunately, I get a NPE while trying to retrieve my mapper :

        {noformat}java.lang.NullPointerException
                at org.apache.maven.shared.model.fileset.mappers.MapperUtil.getFileNameMapper(MapperUtil.java:114)
                at info.rvin.mojo.flexmojo.compiler.ApplicationMojo.setUp(ApplicationMojo.java:194)
                at info.rvin.mojo.flexmojo.AbstractIrvinMojo.execute(AbstractIrvinMojo.java:178)
                at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
                at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
                at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
                at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
                at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:585)
                at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                at org.codehaus.classworlds.Launcher.main(Launcher.java:375){noformat}

        I've checked current trunk on shared/file-management, it seems that the "initializeBuiltIns" call should initialize implementations but it does not.

        I have enclosed a trivial patch which should fix this.
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:14:21 UTC 2015 [ 1428239661755 ]
        Mark Thomas made changes -
        Workflow jira [ 12726099 ] Default workflow, editable Closed status [ 12764504 ]
        Mark Thomas made changes -
        Patch Submitted Yes [ 10763 ]
        Flags Patch [ 10430 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 01:15:59 UTC 2015 [ 1428282959282 ]
        Mark Thomas made changes -
        Workflow jira [ 12963774 ] Default workflow, editable Closed status [ 12999797 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        6h 9m 1 Petar Tahchiev 04/Feb/09 13:52
        In Progress In Progress Open Open
        5m 26s 1 Petar Tahchiev 04/Feb/09 13:57
        Open Open Closed Closed
        3m 27s 1 Petar Tahchiev 04/Feb/09 14:01

          People

          • Assignee:
            Petar Tahchiev
            Reporter:
            jérôme creignou
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development