maven condition based on os family

前端 未结 2 1866
我在风中等你
我在风中等你 2021-01-13 02:54

I am trying to do the following:

                
                    copy-jre         


        
2条回答
  •  一生所求
    2021-01-13 03:17

    The Sonatype book, "Maven: The Complete Reference" section 9.2 deals with maven properties and lists the following properties that are pertinent to your question:

    java.version
    os.name
    

    The java.version property seems usable and in my testing returned "1.6.0_27". However, the os.name property is not exactly an "os family" as you requested. In my case os.name returns "Windows Vista", which I imagine is not what you are hoping for. I don't know of a property to get the os family as you desire it so I recommend using maven profiles as prunge mentioned to handle configuring your plugins with the desired os.

提交回复
热议问题