4 Replies Latest reply on Feb 28, 2013 12:46 PM by wmcdonald

    Using maven settings.xml files in child containers

    wmcdonald Newbie

      Is it possible to define each child container to use a maven settings file to resolve repository urls?  I'd like to use the maven password encryption feature of the settings.xml file to hide the password for the corporate repo.  I'd also like to be able to specify it for just one particular child container - is this possible?

       

      How would I designate my settings.xml file if I put it in a <install-dir>/etc/.m2 dir?

        • 1. Re: Using maven settings.xml files in child containers
          Ioannis Canellos Newbie

          The org.ops4j.pax.url.mvn pid contains a property that allows you to set the location of the settings.xml you will use.

           

          You could set the following property in the org.ops4j.pax.url.mvn in your default profile:

          org.ops4j.pax.url.mvn.settings=${karaf.home}/etc/.m2/settings.xml

          • 2. Re: Using maven settings.xml files in child containers
            wmcdonald Newbie

            I tried without success.  Perhaps I'm doins something wrong.  But perhaps I have not stated the question well enough.

             

            I'm using fuseesb ent 7.1 with fabric.  Looking at the source, org.fusesource.fabric.agent.mvn.MavenSettingsImpl (and other classes in the project), it looks like things have been commented out and that it doesn't let you use the maven settings.xml to specify the username/password.  Most of the docs seem to indicate all I have to do is add it to the repositories property in the agent pid, but then I'd have to specify the username/password in the the URL - I don't want to do that.  I'd rather have it work like maven does with the settings.xml file where I can at least encode the password.

             

            Perhaps the question should be, how can I specify my corporate repo url, yet hide the username password so it isn't in the clear either in some configuration nor in a log file nor in a data file (eg. zookeeper db)? 

             

            Also, it seems that the proper way to do this in fabric is via a profile - this could be container specific then, correct?  Can you give a working example of how i would specify this in a profile-edit command?

            • 3. Re: Using maven settings.xml files in child containers
              Ioannis Canellos Newbie

              You stated your question clearly. It was just me that misunderstood the question

               

              I create a jira so that we allow the agent and maven proxy to make use of repos found in the settings.xml

               

              http://fusesource.com/issues/browse/FABRIC-387

               

              Till then the workaround is to add the repo with the username/password as part of the url:

               

              profile-edit --append --pid org.fusesource.fabric.agent/org.ops4j.pax.url.mvn.repositories=http://username:password@host default

              • 4. Re: Using maven settings.xml files in child containers
                wmcdonald Newbie

                Thanks.  Perhaps a more general request would involve adding different kinds of security, including encrypted passwords, ssl certs, etc.