6 Replies Latest reply on Nov 27, 2012 1:15 AM by kasq

    maven-sling-plugin - installation of bundle with encrypted user password

    kasq Level 3

      HI all,

       

      I just want to ask if it is possible to encrypt password for a repository user which is used to install bunlde by maven script. This is a part of my script:

       

      <plugin>

           <groupId>org.apache.sling</groupId>

           <artifactId>maven-sling-plugin</artifactId>

           <executions> 

                <execution>

                     <id>install-bundle-to-cq</id>

                     <phase>install</phase>

                     <goals>

                           <goal>install</goal>

                     </goals>

                     <configuration>

                            <slingUrl>${crx.url}/system/console/install</slingUrl>

                             <user>${crx.username}</user>

                             <password>${crx.password}</password>

                             <bundleStartLevel>21</bundleStartLevel>

                             <sources>

                                  <source>${project.build.directory}/generated-sources/java/</source>

                             </sources>

                       </configuration>

                 </execution>

           </executions>

      </plugin>

       

      Instead of using defined property crx.password and use password given as a plain text,  I would like to use some mechanism which will encrypt and then decrypt this password when the bundle is installed.

       

      Thanks in advance,

      kasq

        • 1. Re: maven-sling-plugin - installation of bundle with encrypted user password
          justin_at_adobe Adobe Employee

          This is not currently possible. Feel free to file a JIRA issue with the Sling project.

           

          The content-package-maven-plugin does support encrypted passwords, so that may be an option if you can change your build to deploy a content package (which embeds your bundle) rather than just a bundle. Content Packages are the recommended deployment unit for CQ, so this may be a good idea in any case.

           

          Regards,

          Justin

          • 2. Re: maven-sling-plugin - installation of bundle with encrypted user password
            kasq Level 3

            Thanks for this info Justin. At this moment we are using two maven scripts - if we want only install bundle we are using maven-sling-plugin it is faster than install entire package in the repo, but of course we have another script which install also entire package with embeded bundle using plugin mentioned by you. Do you have some links which can help me to understand how to use encrypted password in case of this plugin – maybe some example?

             

            Thanks in advance,

            kasq

            • 4. Re: maven-sling-plugin - installation of bundle with encrypted user password
              kasq Level 3

              I have already read about this encryption functionality in maven, but the problem is how to use encrypted password inside the configuration of content-package-maven-plugin.

               

              This is a part of maven script:

               

              <plugin>

                        <groupId>com.day.jcr.vault</groupId>

                        <artifactId>content-package-maven-plugin</artifactId>

                        <extensions>true</extensions>

                        <configuration>

                <finalName>${nameZipFile}</finalName>

                <group>myproject</group>

                <name>${nameZipFile}</name>

                                  <embeddeds>

                                                 <embedded>

                                                                <groupId>${project.groupId}</groupId>

                                                                <artifactId>myproject-bundle</artifactId>

                                                                <target>/apps/myproject/install</target>

                                                 </embedded>

                                  </embeddeds>

                                  <filters>

                                                 <filter>

                                                                <root>/apps/cq/linkchecker</root>

                                                 </filter>

                                  </filters>

                                  <userId>${crx.user}</userId>

                                  <password>${crx.password}</password>

                                  <useProxy>false</useProxy>

                                  <failOnError>true</failOnError>

                                  <targetURL>${crx.url}/crx/packmgr/service.jsp</targetURL>

                                  <executions>

                                                 <execution>

                                                                <id>install-content-package</id>

                                                                <phase>install</phase>

                                                                <goals>

                                                                               <goal>install</goal>

                                                                </goals>

                                                 </execution>

                                  </executions>

                        </configuration>

              </plugin>

               

              It is possible to point to the settings.xml file and get encrypted password instead of using some already defined property with password?

              • 5. Re: maven-sling-plugin - installation of bundle with encrypted user password
                justin_at_adobe Adobe Employee

                If you follow the Maven guide, you will eventually create an entry in your settings.xml file like:

                <server>

                      <id>my.server</id>

                      <username>foo</username>

                      <password>{COQLCE6DU6GtcS5P=}</password>

                    </server>

                 

                Specify the id of the server definition as the serverId configuration property, either in your pom.xml file or via the vault.serverId CLI option and this server definition will be used.

                 

                If you specify serverId, the username and password set for the plugin in the pom are ignored.

                • 6. Re: maven-sling-plugin - installation of bundle with encrypted user password
                  kasq Level 3

                  Hi Justin,

                   

                  Thanks a lot for your help. Now after changing a maven script everything is working fine with additional configuration related to ecnrypted password for a repository user used to deploy a package in the repository.

                   

                  Regards,

                  kasq