maven把java项目打包,如何把配置文件提出来

2025-01-24 06:25:06
推荐回答(1个)
回答1:

你好:这个把配置文件提取出来可以再pm.xml里面配置java项目文件路径下文件打包方式来实现。举例如下,参考下。


xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4.0.0

com.tmtpt
tmrpt
0.0.1-SNAPSHOT


tmrpt-client
2.2.2
vpetl-client
www.tmrpt.com


UTF-8



com.sun.jna
jna
4.0.0



tmrpt-client
install




org.apache.maven.plugins
maven-jar-plugin

UTF-8


true
lib/
com.vprisk.main.EtlClientStart





package

jar


${basedir}/target/classes
${project.artifactId}-${project.version}
${basedir}/target/maven-archiver

*.conf







org.apache.maven.plugins
maven-dependency-plugin


copy-dependencies
package

copy-dependencies



${project.build.directory}/maven-archiver/lib





  
                maven-resources-plugin  
                  
                      
                        copy-resources  
                        package  
                          
                            copy-resources  
                        
  
                          
                            ${project.build.directory}/maven-archiver/resources  
                              
                                  
                                    ${basedir}/resources  
                                    true