How to wrap an Ant build with Maven?

后端 未结 4 1218
梦如初夏
梦如初夏 2020-12-07 20:32

We use maven for our large-ish product. All of our artifacts are deployed to a shared archiva repository using the maven deploy goal. I am now integrating a third party pr

4条回答
  •  星月不相逢
    2020-12-07 21:20

    You can use the maven-antrun-plugin to invoke the ant build. Then use the build-helper-maven-plugin to attach the jar produced by ant to the project. The attached artifact will be installed/deployed alongside the pom.
    If you specify your project with packaging pom, Maven will not conflict with the ant build.

    In the example below, the ant build.xml is assumed to be in src/main/ant, have a compile goal, and output to ant-output.jar.

    
      maven-antrun-plugin
      
        
          process-resources
          
            
              
            
          
          
            run
          
        
      
    
    
      org.codehaus.mojo
      build-helper-maven-plugin
      1.3
      
        
          add-jar
          package
          
            attach-artifact
          
          
            
              
                ${project.build.directory}/ant-output.jar
                jar
              
            
          
        
      
    
    

提交回复
热议问题