How do I exclude the sources jar in mvn deploy?

后端 未结 7 984
半阙折子戏
半阙折子戏 2021-01-01 17:03

When I run \"mvn deploy:deploy\", maven deploys 4 jar files to my internal remote repository.

They are:

[module-name]-1.jar
[module-name]-1.pom
[modu

7条回答
  •  误落风尘
    2021-01-01 17:11

    Let me assume that you shoudn't skip generating sources for a module. In that case, this would be a simple solution which helps you to handle this scenario :

    In the execution part of "maven-source-plugin" under plugins section, set the attach attribute to false. This configuration will generate the sources.jar for your module, but not attached it to the project's artifact list.

    The example snippet is here:

    
        
            org.apache.maven.plugins
            maven-source-plugin
            ${source.plugin.version}
            
                
                    module1-sources
                    verify
                    
                        jar-no-fork
                    
                    
                        
                        false
                    
                
            
        
    
    

提交回复
热议问题