Out-of-tree build with maven. Is it possible?

后端 未结 2 1403
独厮守ぢ
独厮守ぢ 2020-12-18 06:23

I start learning packaging for several distros (currently Cygwin and Debian).

They have requirement to build system to allow out-of-tree build (syno

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 06:38

    You could do like this to get it in your current working directory:

    
        4.0.0
    
        com.stackoverflow
        Q13173063
        1.0-SNAPSHOT
    
        ${project.artifactId}-${project.version}
    
        
            UTF-8
            ${user.dir}
        
    
        
            ${buildDir}
        
    
    

    Then you can issue

    mvn -f my-app/pom.xml compile
    

    And it will give you your classes in the current working directory.

    And easily change to another output directory:

    mvn -f my-app/pom.xml -DbuildDir=/tmp/build compile
    

提交回复
热议问题