maven assembly include the current project jar in the final zip/tar

后端 未结 1 1038
北荒
北荒 2020-12-29 20:36

I am using maven assembly plugin to generate a .tar file contain several other files, dependent jars. All the files are being copied correctly to the given fold

1条回答
  •  [愿得一人]
    2020-12-29 20:42

    In you can exclude the current project jar by saying false, but it's true by default, so it should work.

    From the warning, it seems that you need to do mvn package first, but due to some internal maven issue, it does not work if you do mvn package and mvn assembly:single in separate commands.

    It works if you do mvn package assembly:single in one command.

    Alternatively, add maven-assembly-plugin in your pom and bind it to the 'package' phase so it will trigger automatically on mvn package:

       
            maven-assembly-plugin
            
              
                tar-assembly
                package
                
                  single
                
                
                  
                    etc/assembly.xml
                  
                
              
            
          
    

    0 讨论(0)
提交回复
热议问题