Maven use Encrypted passwords in POM

Daniel Hernández

How can I use encrypted password in pom.xml with maven 3?

I have some pom that use password that are very delicated for us, for example we have POM to deploy in Application servers such as Weblogic or run Scripts in the database, and we don't like to just put the password as it is.

I already have the master password for deployment artifacts.

I am thinking if there is a way for example to generate a password:

$ mvn --encrypt-password somepass
{wGpHaPO3nJ4HSKJa7qcMK9qjHAdwlvMrtjYjj8bwguI=}

And after that Can I use it in some pom in this way:

<configuration>
  <driver>oracle.jdbc.driver.OracleDriver</driver>
  <url>jdbc:oracle:thin:@ordbsdev.siman.com:1521:RMSDEV</url>
  <username>${siman.rms13.db.user}</username>
  <password>{wGpHaPO3nJ4HSKJa7qcMK9qjHAdwlvMrtjYjj8bwguI=}</password>
</configuration>

Also, I would appreciate an alternative to do it.

Robert Reiner

I think what Tunaki is asking you to do is to define a property in your settings.xml, e.g.

<settings ...

  <profile>
    ...
    <properties>
      <xyz>{wGpHaPO3nJ4HSKJa7qcMK9qjHAdwlvMrtjYjj8bwguI=}</xyz>
    </properties>
  <profile>
</setting>

Then use this property from your settings in your POM:

<configuration>
  ...
  <password>${xyz}</password>
</configuration>

But the tool reading this configuration has to be capable to decrypt the password.

Even better would be to store the encrypted password with a server configuration in your settings.xml like this:

<settings ...
  ...
  <servers>
    ...
    <server>
      <id>xyz</id>
      <username>manager</username>
      <password>{wGpHaPO3nJ4HSKJa7qcMK9qjHAdwlvMrtjYjj8bwguI=}</password>
    </server>
    ...
  </servers>
  ...
</setting>

But again, the consumer of your configuration information has to be capable of reading server configurations. There is an example for the Maven Deploy Plugin at https://maven.apache.org/guides/mini/guide-encryption.html (e.g. -DrepositoryId=xyz).

The referenced question lists the SqlExecMojo as an example on how plugins decrypt passwords.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

maven update pom property

From Dev

Maven: how to use POM elements from within assembly descriptor

From Dev

PHP - Using a one-time pad to store encrypted passwords

From Dev

How to create encrypted hash passwords for drupal 7

From Dev

psexec in Powershell doesn't accept encrypted passwords

From Dev

Generating encrypted passwords in mysql, to populate a django database

From Dev

Analyze Maven pom with SonarQube

From Dev

Maven package effective pom

From Dev

windows encrypted rdp passwords in golang

From Dev

how to generate encrypted passwords for use with Hipster

From Dev

maven pom xml variables

From Dev

How to variablize shell script output on maven pom.xml to use

From Dev

Maven/Swagger: generate a module (including POM) -- then use it as dep in same build?

From Dev

Use an encrypted token or not?

From Dev

Maven: Read encrypted password from settings.xml in pom.xml

From Dev

What is use of enabled(snapshot, releases) tag in maven pom's repository element?

From Dev

Disable distributionManagement in Maven POM

From Dev

Maven not accepting encrypted nexus password

From Dev

The use of UrlEncodedFormEntity to send passwords

From Dev

Generating encrypted passwords in mysql, to populate a django database

From Dev

Migrating customer logins with encrypted passwords

From Dev

Is it safe to store (encrypted) passwords on GitHub?

From Dev

Does Usergrid store passwords as plaintext or encrypted?

From Dev

Setting up mutt with pass to handle encrypted passwords

From Dev

Using cookies to securely store encrypted third-party passwords in DB

From Dev

Does the shadow file have encrypted passwords?

From Dev

Scratch building a Maven POM

From Dev

Maven "conditional" parent POM?

From Dev

Should I upload my gpt encrypted passwords to github?

Related Related

  1. 1

    maven update pom property

  2. 2

    Maven: how to use POM elements from within assembly descriptor

  3. 3

    PHP - Using a one-time pad to store encrypted passwords

  4. 4

    How to create encrypted hash passwords for drupal 7

  5. 5

    psexec in Powershell doesn't accept encrypted passwords

  6. 6

    Generating encrypted passwords in mysql, to populate a django database

  7. 7

    Analyze Maven pom with SonarQube

  8. 8

    Maven package effective pom

  9. 9

    windows encrypted rdp passwords in golang

  10. 10

    how to generate encrypted passwords for use with Hipster

  11. 11

    maven pom xml variables

  12. 12

    How to variablize shell script output on maven pom.xml to use

  13. 13

    Maven/Swagger: generate a module (including POM) -- then use it as dep in same build?

  14. 14

    Use an encrypted token or not?

  15. 15

    Maven: Read encrypted password from settings.xml in pom.xml

  16. 16

    What is use of enabled(snapshot, releases) tag in maven pom's repository element?

  17. 17

    Disable distributionManagement in Maven POM

  18. 18

    Maven not accepting encrypted nexus password

  19. 19

    The use of UrlEncodedFormEntity to send passwords

  20. 20

    Generating encrypted passwords in mysql, to populate a django database

  21. 21

    Migrating customer logins with encrypted passwords

  22. 22

    Is it safe to store (encrypted) passwords on GitHub?

  23. 23

    Does Usergrid store passwords as plaintext or encrypted?

  24. 24

    Setting up mutt with pass to handle encrypted passwords

  25. 25

    Using cookies to securely store encrypted third-party passwords in DB

  26. 26

    Does the shadow file have encrypted passwords?

  27. 27

    Scratch building a Maven POM

  28. 28

    Maven "conditional" parent POM?

  29. 29

    Should I upload my gpt encrypted passwords to github?

HotTag

Archive