3 Replies Latest reply on Jan 21, 2013 5:17 AM by tsegismont

    Support resolution of variables in Maven settings file

    tsegismont

      Variables in Maven settings file are not resolved.

       

      For instance if you have this node in your settings.xml file :

       

      <localRepository>${user.home}/.m2/repository</localRepository>
      

       

      then Shrinkwrap will create a ${user.home}/.m2/repository in the project directory and use it as local repository.

       

      We use Arquillian 1.0.3.Final and have Shrinkwrap 1.0.0-beta7 from Arquillian BOM.

       

       

      The reason seems to be that MavenSettingsBuilder (shrinkwrap-resolver-impl-maven) creates a DefaultSettingsBuildingRequest which holds empty system and user properties. So when the Maven SettingsBuilder is called:

       

            SettingsBuildingResult result;
            try
            {
               SettingsBuilder builder = new DefaultSettingsBuilderFactory().newInstance();
               result = builder.build(request);
            }
            catch (SettingsBuildingException e)
            {
               e.printStackTrace();
               throw new RuntimeException("Unable to parse Maven configuration", e);
            }
      

       

      it has no system nor user properties with which it could use to resolve settings.xml variables.

       

      It would be great to be able to keep environment variables in settings xml file.

       

      Thanks and regards

      Thomas