How can I speed up my maven2 build?

前端 未结 8 2157
孤独总比滥情好
孤独总比滥情好 2020-12-13 04:29

I\'m using a local artifactory to proxy the request, but the build and test phases are still a bit slow. It\'s not the actual compile and tests that are slow, it\'s the \"wa

8条回答
  •  隐瞒了意图╮
    2020-12-13 04:51

    I don't know what version of Maven you are using, I assume 2, but I will give what I use for Maven 1.x to speed up and make things build a tiny bit quicker.

    These will fork the junit tests into a new process (also helps when you use environment variables in tests etc and gives the tests a little more memory.

    -Dmaven.junit.fork=true
    -Dmaven.junit.jvmargs=-Xmx512m
    

    This forks the compilation which might speed things up for you

    -Dmaven.compile.fork=true
    

    I hope this can help a little, try it out.

    Also refer to get more speed with your maven2 build.

提交回复
热议问题