java 默认设置了启动参数 打包会打进去吗 -Djasypt.encryptor.password=salt20220907
时间: 2024-05-14 14:13:27 浏览: 19
默认情况下,Java启动时设置的参数不会被打包进去。它们只是在运行时被传递给Java虚拟机。如果您需要将这些参数打包进JAR文件中,您需要使用Maven或Gradle等构建工具来将它们打包进去。例如,在Maven中,您可以在pom.xml文件中设置以下内容:
```
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Jasypt-Encryptor-Password>salt20220907</Jasypt-Encryptor-Password>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
```
这将在JAR文件的MANIFEST.MF文件中添加一个名为"Jasypt-Encryptor-Password"的条目,并将其设置为"salt20220907"。在运行JAR文件时,您可以使用以下命令行参数来指定该值:
```
java -jar myapp.jar -DJasypt-Encryptor-Password=salt20220907
```
相关推荐
![.zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![whl](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)