jasypt-spring-boot icon indicating copy to clipboard operation
jasypt-spring-boot copied to clipboard

jasypt:encrypt{,-value} always fails in multi-module project

Open chrylis opened this issue 2 years ago • 0 comments

When using either encrypt and specifying path or using encrypt-value (where no path should be necessary), the Maven plugin always fails because file:./src/main/resources does not exist. This seems to be due to not properly handing off the path or mode to a Spring Boot(?) launcher.

[DEBUG] Configuring mojo 'com.github.ulisesbocchio:jasypt-maven-plugin:3.0.4:encrypt-value' with basic configurator -->
[DEBUG]   (f) decryptPrefix = DEC(
[DEBUG]   (f) decryptSuffix = )
[DEBUG]   (f) encryptPrefix = ENC(
[DEBUG]   (f) encryptSuffix = )
[DEBUG] -- end configuration --
[DEBUG] Application failed to start due to an exception
org.springframework.boot.context.config.ConfigDataLocationNotFoundException: Config data location 'file:./src/main/resources/' cannot be found
    at org.springframework.boot.context.config.ConfigDataEnvironment.checkMandatoryLocations (ConfigDataEnvironment.java:383)
    at org.springframework.boot.context.config.ConfigDataEnvironment.applyToEnvironment (ConfigDataEnvironment.java:326)
    at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply (ConfigDataEnvironment.java:233)
    at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment (ConfigDataEnvironmentPostProcessor.java:102)
    at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment (ConfigDataEnvironmentPostProcessor.java:94)
    at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent (EnvironmentPostProcessorApplicationListener.java:102)
    at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent (EnvironmentPostProcessorApplicationListener.java:87)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener (SimpleApplicationEventMulticaster.java:176)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener (SimpleApplicationEventMulticaster.java:169)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent (SimpleApplicationEventMulticaster.java:143)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent (SimpleApplicationEventMulticaster.java:131)
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared (EventPublishingRunListener.java:82)
    at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2 (SpringApplicationRunListeners.java:63)
    at java.util.ArrayList.forEach (ArrayList.java:1541)
    at org.springframework.boot.SpringApplicationRunListeners.doWithListeners (SpringApplicationRunListeners.java:117)
    at org.springframework.boot.SpringApplicationRunListeners.doWithListeners (SpringApplicationRunListeners.java:111)
    at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared (SpringApplicationRunListeners.java:62)
    at org.springframework.boot.SpringApplication.prepareEnvironment (SpringApplication.java:374)
    at org.springframework.boot.SpringApplication.run (SpringApplication.java:332)
    at org.springframework.boot.builder.SpringApplicationBuilder.run (SpringApplicationBuilder.java:143)
    at com.ulisesbocchio.jasyptmavenplugin.mojo.AbstractJasyptMojo.execute (AbstractJasyptMojo.java:65)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 

This is happening with 3.0.4.

chrylis avatar Mar 10 '22 18:03 chrylis