maven deploy additional jar file

前端 未结 6 1015
花落未央
花落未央 2020-12-30 00:05

I have an artifact which is being built and deployed in a particular way (not as a jar file). In the course of deployment, a war file is built.

How can I configure t

6条回答
  •  清酒与你
    2020-12-30 00:27

    This blog post and its comments have the answer.

    These three plugin configurations will allow you to build/install/deploy a jar version alongside the war.

    
        org.apache.maven.plugins
        maven-jar-plugin
        
            
                make-a-jar
                compile
                
                    jar
                
            
        
    
    
        org.apache.maven.plugins
        maven-install-plugin
        
            
                install
                
                    install-file
                
                
                    jar
                    ${project.artifactId}
                    ${project.groupId}
                    ${project.version}
                    
                        ${project.build.directory}/${project.artifactId}-${project.version}.jar
                    
                
            
        
    
    
        org.apache.maven.plugins
        maven-deploy-plugin
        
            
                deploy
                
                    deploy-file
                
                
                    jar
                    true
                    ${project.distributionManagement.repository.url}
                    ${project.artifactId}
                    ${project.groupId}
                    ${project.version}
                    ${project.build.directory}/${project.artifactId}-${project.version}.jar
                
            
        
    
    

提交回复
热议问题