Jasypt Maven 插件:"Unknown lifecycle phase"

Jasypt Maven plugin: "Unknown lifecycle phase"

documentation所述:

  1. 添加到 pom.xml(并执行 Maven 重新加载)
    <plugin>
        <groupId>com.github.ulisesbocchio</groupId>
        <artifactId>jasypt-maven-plugin</artifactId>
        <version>3.0.3</version>
    </plugin>
    
  2. 为了尝试一下,我 运行 Maven 使用这个插件来获取单个加密值:
    mvn jasypt:encrypt-value -Djasypt.encryptor.password="the password" -Djasypt.plugin.value="theValueYouWantToEncrypt"
    

但我得到以下 [ERROR]:

[ERROR] Unknown lifecycle phase ".encryptor.password=the password". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>

我假设插件安装正确,因为即使我的 IDE 也能识别它:

有什么想法吗?

这个命令行对我有用。

mvn jasypt:encrypt-value "-Djasypt.encryptor.password=password" "-Djasypt.plugin.value=test"

痕迹

[INFO] Active Profiles: Default
[INFO] Encrypting value test
[INFO] String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
[INFO] Encryptor config not found for property jasypt.encryptor.algorithm, using default value: PBEWITHHMACSHA512ANDAES_256
[INFO] Encryptor config not found for property jasypt.encryptor.key-obtention-iterations, using default value: 1000
[INFO] Encryptor config not found for property jasypt.encryptor.pool-size, using default value: 1
[INFO] Encryptor config not found for property jasypt.encryptor.provider-name, using default value: null
[INFO] Encryptor config not found for property jasypt.encryptor.provider-class-name, using default value: null
[INFO] Encryptor config not found for property jasypt.encryptor.salt-generator-classname, using default value: org.jasypt.salt.RandomSaltGenerator
[INFO] Encryptor config not found for property jasypt.encryptor.iv-generator-classname, using default value: org.jasypt.iv.RandomIvGenerator
[INFO] Encryptor config not found for property jasypt.encryptor.string-output-type, using default value: base64
[INFO]
ENC(5P+yq0XlMiew9438IxsILCXs/2nGH2C4eq3IYamXoDeVeYdzoJLhLZPBMpGC4kMA)