Maven deploy + source classifiers

前端 未结 3 893
余生分开走
余生分开走 2021-01-13 12:44

I\'m trying to deploy a Maven artifact with a classifier. Since I need both the sources and the JAR (I\'m using it from GWT), I would like to get artifact-version-clas

3条回答
  •  忘掉有多难
    2021-01-13 13:41

    Sadly, attaching a source JAR with an arbitrary classifier is not supported by the source plugin. When the source artifact is attached, the classifier is hardcoded (as of version 2.1.2 of source plugin).

    You can work around the issue by getting the source plugin to generate the JAR but not attach, and attach it with the build helper plugin's attach artifact goal.

    
        org.codehaus.mojo
        build-helper-maven-plugin
        1.7
        
            
                attach-source-jar
                package
                
                    attach-artifact
                
                
                    
                        
                            ${project.build.directory}/${project.build.finalName}-prod-sources.jar
                            jar
                            prod-sources
                        
                    
                
            
        
    
    

提交回复
热议问题