Using the maven-remote-resources-plugin and specifying the resourcesDirectory

后端 未结 2 1857
[愿得一人]
[愿得一人] 2021-01-20 02:16

I\'m trying to override the default resources directory (src/main/resources) when using the maven-remote-resources-plugin. However the specified value in the sample

2条回答
  •  情书的邮戳
    2021-01-20 03:01

    Why do you need maven-remote-resources-plugin?

    If your goal is to override the default resources directory ,then you can use mvn resources:copy-resources, since it's more flexible. An example here.

    Alternative

    You can also use the resources goal provided by resources plugin, and specify the resources in pom file's block. Example here.


    Edit

    About maven-remote-resources-plugin, see the usage page:

    This will trigger the scanning of that project's $basedir/src/main/resources directory and create the $basedir/target/classes/META-INF/maven/remote-resources.xml manifest file.

    That means this plugin will create the remote-resources.xml file, but it doesn't mean that it will copy the resources for you.

    I created an empty maven project using your plugin configuration, and it actually did create an remote-resources.xml file. Also, it did not copy the files under ${basedir}/common

    To do that, just specify the resources in build section. Example:

    
            
                
                    ${basedir}/common
                
                
                    ${basedir}/src/main/resources
                
            
            
                
                    org.apache.maven.plugins
                    maven-remote-resources-plugin
                    1.5
                    
                        
                            
                                bundle
                            
                        
                    
                    
                        ${basedir}/common
                        
                            **/*
                        
                    
                
            
    
    

提交回复
热议问题