0
votes

Our pom.xml for osb service refers to the maven settings.xml to get the server details and credentials for deployment. pom.xml has below entries:

<plugins>
    <plugin>
    <groupId>com.oracle.servicebus.plugin</groupId>
    <artifactId>oracle-servicebus-plugin</artifactId>
    <version>12.2.1-4-0</version>
    <extensions>true</extensions>
    <configuration>
        <oracleHome>${oracleHome}</oracleHome>
        <oracleServerUrl>${oracleServerUrl}</oracleServerUrl>
        <oracleUsername>${oracleUsername}</oracleUsername>
        <oraclePassword>${oraclePassword}</oraclePassword>
    </configuration>
    </plugin>
</plugins>

settings.xml has got below entries:

<profile>
  <id>server-devb</id>
  <properties>
    <oracleHome>/oracle/apps/fusion/devb_soa_suite_12_2_1_4_0</oracleHome>
    <oracleServerUrl>http://esb-soa-server1-devb:7001</oracleServerUrl>
    <oracleSoaServerUrl>http://esb-soa-server1-devb:8001</oracleSoaServerUrl>
    <oracleServerT3>t3://esb-soa-server1-devb:7001</oracleServerT3>
    <oracleUsername>weblogic_buildserver</oracleUsername>
    <oraclePassword>{WhEa5AhivzUHwQHIv7oQHsbBjcA3e5jKuMpjTzPTbkZevhD9UUjr34NEY5ROPgEI} 
    </oraclePassword>
  </properties>
</profile>

If we keep the password in settings.xml as plaintext, the deployment works fine. but if we encrypt it, it fails in user authentication while deployment.

we followed this guide for maven password encryption - https://maven.apache.org/guides/mini/guide-encryption.html#introduction

1
What do you mean by "it fails"? - J Fabian Meier
we get below error: java.lang.SecurityException: User failed to be authenticated. at weblogic.common.internal.RMIBootServiceImpl.authenticate(RMIBootServiceImpl.java:121) at weblogic.common.internal.RMIBootServiceImpl_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:645) at weblogic.rmi.internal.BasicServerRef$2.run(BasicServerRef.java:534) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedS - Vivek Vishal
This password must be encrypted with WebLogic tooling and with the salt stored in your domain. The easiest way is to get the excrypted password from the boot.properties file which is under $DOMAIN_HOME/servers/AdminServer/security - Emmanuel Collin

1 Answers

0
votes

you can try with this, you need to encrypt a password using this link and then configure the oracle-servicebus-plugin to use it.

  1. Create a master password with the command:

    mvn --encrypt-master-password
    

Maven will prompt you for the password since 3.2.1. Once you did that, create a file called ~/.m2/settings-security.xml with the content

<settingsSecurity>
  <master><!-- result of above command --></master>
</settingsSecurity>
  1. Encrypt your password with the command

    mvn --encrypt-password
    

Same as before, Maven will prompt you for the password. Then in your Maven settings (~/.m2/settings.xml, create the file if it doesn't exist), add the below content

<settings>
...
  <servers>
  ...
    <server>
      <id>my.server</id>
      <username><!-- your DB username --></username>
      <password><!-- the encrypted password --></password>
    </server>
  ...
  </servers>
...
</settings>
  1. Configure your oracle-servicebus-plugin with the settingsKey attribute to your server id, which in this case would be my.server.
<plugin>
  <groupId> org.codehaus.mojo </groupId>
  <artifactId>sql-maven-plugin</artifactId>   
  <version>1.5</version> <!-- 1.5 required -->
  <configuration>
    <settingsKey>my.server</settingsKey> <!-- id of server here -->
    <driver>----</driver>
    <url>----</url>
    <!-- username and password are not mentioned anymore -->
  </configuration>
</plugin>

If any of the encrypted passwords contain curly braces, you'll need to escape them by having \{ and \}.