[SPARK-3787][BUILD] Assembly jar name is wrong when we build with sbt omitting -Dhadoop.version
[SPARK-3787][BUILD] Assembly jar name is wrong when we build with sbt omitting -Dhadoop.version

This PR is another solution for When we build with sbt with profile for hadoop and without property for hadoop version like:

    sbt/sbt -Phadoop-2.2 assembly

jar name is always used default version (1.0.4).

When we build with maven with same condition for sbt, default version for each profile is used.
For instance, if we  build like:

    mvn -Phadoop-2.2 package

jar name is used hadoop2.2.0 as a default version of hadoop-2.2.

Author: Kousuke Saruta <sarutak@oss.nttdata.co.jp>

Closes #3046 from sarutak/fix-assembly-jarname-2 and squashes the following commits:

41ef90e [Kousuke Saruta] Merge branch 'master' of git://git.apache.org/spark into fix-assembly-jarname-2
50c8676 [Kousuke Saruta] Merge branch 'fix-assembly-jarname-2' of github.com:sarutak/spark into fix-assembly-jarname-2
52a1cd2 [Kousuke Saruta] Fixed comflicts
dd30768 [Kousuke Saruta] Merge branch 'master' of git://git.apache.org/spark into fix-assembly-jarname2
f1c90bb [Kousuke Saruta] Fixed SparkBuild.scala in order to read `hadoop.version` property from pom.xml
af6b100 [Kousuke Saruta] Merge branch 'master' of git://git.apache.org/spark into fix-assembly-jarname
c81806b [Kousuke Saruta] Merge branch 'master' of git://git.apache.org/spark into fix-assembly-jarname
ad1f96e [Kousuke Saruta] Merge branch 'master' of git://git.apache.org/spark into fix-assembly-jarname
b2318eb [Kousuke Saruta] Merge branch 'master' of git://git.apache.org/spark into fix-assembly-jarname
5fc1259 [Kousuke Saruta] Fixed typo.
eebbb7d [Kousuke Saruta] Fixed wrong jar name

janewangfb/spark,wangmiao1981/spark,liyichao/spark,big-pegasus/spark,wangmiao1981/spark,someorz/spark,brad-kaiser/spark,kevinyu98/spark,tengpeng/spark,kevinyu98/spark,HyukjinKwon/spark,JerryLead/spark,jkbradley/spark,setjet/spark,bOOm-X/spark,shaneknapp/spark,byakuinss/spark,jkbradley/spark,metamx/spark,esi-mineset/spark,pronix/spark,cin/spark,vinodkc/spark,wangyum/spark,akopich/spark,kevinyu98/spark,shuangshuangwang/spark,haowu80s/spark,ahnqirage/spark,brad-kaiser/spark,caneGuy/spark,sahilTakiar/spark,jlopezmalla/spark,rednaxelafx/apache-spark,bdrillard/spark,witgo/spark,SHASHANKB/spark,eyalfa/spark,spark-test/spark,rikima/spark,SHASHANKB/spark,aokolnychyi/spark,kimoonkim/spark,michalsenkyr/spark,hhbyyh/spark,Aegeaner/spark,zero323/spark,1haodian/spark,stanzhai/spark,rikima/spark,ptkool/spark,byakuinss/spark,skonto/spark,rekhajoshm/spark,SnappyDataInc/spark,hhbyyh/spark,UndeadBaneGitHub/spark,Aegeaner/spark,srowen/spark,WeichenXu123/spark,mahak/spark,dbtsai/spark,liutang123/spark,nlalevee/spark,setjet/spark,pronix/spark,tejasapatil/spark,akopich/spark,tejasapatil/spark,bdrillard/spark,adrian-ionescu/apache-spark,akopich/spark,metamx/spark,panfengfeng/spark,ddna1021/spark,ConeyLiu/spark,ueshin/apache-spark,setjet/spark,maropu/spark,huang1900/spark,shuangshuangwang/spark,srowen/spark,jrshust/spark,markhamstra/spark,1haodian/spark,WeichenXu123/spark,wzhfy/spark,cloud-fan/spark,michalsenkyr/spark,ueshin/apache-spark,bOOm-X/spark,rezasafi/spark,map222/spark,map222/spark,minixalpha/spark,publicRoman/spark,SHASHANKB/spark,Panos-Bletsos/spark-cost-model-optimizer,mzl9039/spark,cin/spark,lvdongr/spark,kiszk/spark,lvdongr/spark,panfengfeng/spark,brad-kaiser/spark,esi-mineset/spark,tejasapatil/spark,nilsgrabbert/spark,caneGuy/spark,gengliangwang/spark,mdespriee/spark,ron8hu/spark,HyukjinKwon/spark,zuotingbing/spark,BryanCutler/spark,kissmetrics/spark,rikima/spark,shuangshuangwang/spark,adrian-ionescu/apache-spark,wangmiao1981/spark,WindCanDie/spark,yanboliang/spark,kiszk/spark,ddna1021/spark,gengliangwang/spark,setjet/spark,WindCanDie/spark,BryanCutler/spark,milliman/spark,tengpeng/spark,witgo/spark,darionyaphet/spark,kiszk/spark,guoxiaolongzte/spark,dhruve/spark,skonto/spark,holdenk/spark,tengpeng/spark,bravo-zhang/spark,nilsgrabbert/spark,markhamstra/spark,pronix/spark,szhem/spark,narahari92/spark,aosagie/spark,ioana-delaney/spark,Aegeaner/spark,liutang123/spark,guoxiaolongzte/spark,HyukjinKwon/spark,byakuinss/spark,mahak/spark,mike0sv/spark,goldmedal/spark,esi-mineset/spark,alunarbeach/spark,ibm-research-ireland/sparkoscope,stanzhai/spark,sahilTakiar/spark,yanboliang/spark,taroplus/spark,UndeadBaneGitHub/spark,poffuomo/spark,ConeyLiu/spark,apache-spark-on-k8s/spark,lxsmnv/spark,liutang123/spark,witgo/spark,ibm-research-ireland/sparkoscope,metamx/spark,cin/spark,JoshRosen/spark,stanzhai/spark,WeichenXu123/spark,taroplus/spark,tejasapatil/spark,gioenn/xSpark,holdenk/spark,maropu/spark,loneknightpy/spark,setjet/spark,sahilTakiar/spark,loneknightpy/spark,chuckchen/spark,wzhfy/spark,LantaoJin/spark,hvanhovell/spark,facaiy/spark,vinodkc/spark,kissmetrics/spark,kissmetrics/spark,Panos-Bletsos/spark-cost-model-optimizer,ptkool/spark,hvanhovell/spark,icexelloss/spark,adrian-ionescu/apache-spark,sachintyagi22/spark,WindCanDie/spark,mzl9039/spark,nilsgrabbert/spark,zzcclp/spark,ron8hu/spark,cloud-fan/spark,debugger87/spark,loneknightpy/spark,kimoonkim/spark,kissmetrics/spark,MLnick/spark,guoxiaolongzte/spark,stanzhai/spark,narahari92/spark,adrian-ionescu/apache-spark,ajaysaini725/spark,WindCanDie/spark,MLnick/spark,Panos-Bletsos/spark-cost-model-optimizer,mahak/spark,chuckchen/spark,zero323/spark,Panos-Bletsos/spark-cost-model-optimizer,zhouyejoe/spark,xuanyuanking/spark,ddna1021/spark,bdrillard/spark,mike0sv/spark,bOOm-X/spark,skonto/spark,alunarbeach/spark,stanzhai/spark,darionyaphet/spark,publicRoman/spark,shubhamchopra/spark,aray/spark,yanboliang/spark,andrewor14/iolap,shaneknapp/spark,aray/spark,mahak/spark,rekhajoshm/spark,icexelloss/spark,setjet/spark,Panos-Bletsos/spark-cost-model-optimizer,xuanyuanking/spark,bdrillard/spark,huang1900/spark,hvanhovell/spark,dongjoon-hyun/spark,jianran/spark,joseph-torres/spark,shubhamchopra/spark,poffuomo/spark,andrewor14/iolap,ddna1021/spark,dhruve/spark,wangyum/spark,milliman/spark,dongjoon-hyun/spark,vinodkc/spark,ibm-research-ireland/sparkoscope,lxsmnv/spark,saturday-shi/spark,sureshthalamati/spark,caneGuy/spark,joseph-torres/spark,spark-test/spark,patrick-nicholson/spark,yanboliang/spark,SHASHANKB/spark,akopich/spark,jrshust/spark,UndeadBaneGitHub/spark,jianran/spark,dhruve/spark,adrian-ionescu/apache-spark,bdrillard/spark,jlopezmalla/spark,dbtsai/spark,saltstar/spark,nilsgrabbert/spark,mike0sv/spark,jkbradley/spark,darionyaphet/spark,nchammas/spark,zuotingbing/spark,JoshRosen/spark,LantaoJin/spark,matthewfranglen/spark,zuotingbing/spark,eyalfa/spark,Aegeaner/spark,mike0sv/spark,icexelloss/spark,LantaoJin/spark,sureshthalamati/spark,wangyum/spark,jianran/spark,zhouyejoe/spark,ahnqirage/spark,1haodian/spark,adrian-ionescu/apache-spark,jiangxb1987/spark,byakuinss/spark,publicRoman/spark,JerryLead/spark,markhamstra/spark,alunarbeach/spark,xflin/spark,kimoonkim/spark,ueshin/apache-spark,BryanCutler/spark,nilsgrabbert/spark,aokolnychyi/spark,someorz/spark,mike0sv/spark,apache-spark-on-k8s/spark,byakuinss/spark,janewangfb/spark,ericvandenbergfb/spark,srowen/spark,metamx/spark,actuaryzhang/spark,lxsmnv/spark,holdenk/spark,mahak/spark,techaddict/spark,apache/spark,sahilTakiar/spark,witgo/spark,goldmedal/spark,apache/spark,apache/spark,stanzhai/spark,saturday-shi/spark,kevinyu98/spark,rekhajoshm/spark,szhem/spark,HyukjinKwon/spark,darionyaphet/spark,gengliangwang/spark,apache-spark-on-k8s/spark,xuanyuanking/spark,publicRoman/spark,szhem/spark,nlalevee/spark,mike0sv/spark,loneknightpy/spark,byakuinss/spark,ptkool/spark,pgandhi999/spark,bOOm-X/spark,ahnqirage/spark,ptkool/spark,dhruve/spark,srowen/spark,panfengfeng/spark,wangyum/spark,skonto/spark,nchammas/spark,guoxiaolongzte/spark,gengliangwang/spark,tengpeng/spark,haowu80s/spark,SnappyDataInc/spark,hvanhovell/spark,pgandhi999/spark,jianran/spark,xuanyuanking/spark,aosagie/spark,narahari92/spark,mdespriee/spark,tengpeng/spark,wzhfy/spark,aokolnychyi/spark,maropu/spark,zhouyejoe/spark,loneknightpy/spark,holdenk/spark,MLnick/spark,saturday-shi/spark,vinodkc/spark,chuckchen/spark,akopich/spark,someorz/spark,maropu/spark,xuanyuanking/spark,panfengfeng/spark,patrick-nicholson/spark,shaneknapp/spark,zuotingbing/spark,cloud-fan/spark,dbtsai/spark,zzcclp/spark,shubhamchopra/spark,xflin/spark,minixalpha/spark,bravo-zhang/spark,map222/spark,rednaxelafx/apache-spark,liyichao/spark,lxsmnv/spark,kiszk/spark,guoxiaolongzte/spark,JerryLead/spark,hhbyyh/spark,rekhajoshm/spark,nlalevee/spark,hvanhovell/spark,mdespriee/spark,chuckchen/spark,mdespriee/spark,WindCanDie/spark,ericvandenbergfb/spark,bravo-zhang/spark,HyukjinKwon/spark,huang1900/spark,BryanCutler/spark,esi-mineset/spark,joseph-torres/spark,brad-kaiser/spark,witgo/spark,jiangxb1987/spark,michalsenkyr/spark,kimoonkim/spark,apache-spark-on-k8s/spark,apache/spark,MLnick/spark,actuaryzhang/spark,apache-spark-on-k8s/spark,ajaysaini725/spark,ahnqirage/spark,aokolnychyi/spark,holdenk/spark,shubhamchopra/spark,wzhfy/spark,wzhfy/spark,akopich/spark,lvdongr/spark,eyalfa/spark,saltstar/spark,kevinyu98/spark,kiszk/spark,zuotingbing/spark,jianran/spark,MLnick/spark,jiangxb1987/spark,michalsenkyr/spark,dongjoon-hyun/spark,kiszk/spark,shubhamchopra/spark,andrewor14/iolap,xflin/spark,cloud-fan/spark,sachintyagi22/spark,mahak/spark,bdrillard/spark,hhbyyh/spark,mdespriee/spark,JerryLead/spark,highfei2011/spark,witgo/spark,narahari92/spark,techaddict/spark,publicRoman/spark,bOOm-X/spark,debugger87/spark,michalsenkyr/spark,publicRoman/spark,liutang123/spark,cloud-fan/spark,JoshRosen/spark,andrewor14/iolap,andrewor14/spark,HyukjinKwon/spark,metamx/spark,ddna1021/spark,liyichao/spark,sahilTakiar/spark,liyichao/spark,hhbyyh/spark,ioana-delaney/spark,techaddict/spark,Aegeaner/spark,facaiy/spark,xflin/spark,eyalfa/spark,HyukjinKwon/spark,jkbradley/spark,brad-kaiser/spark,kevinyu98/spark,aray/spark,akopich/spark,byakuinss/spark,yanboliang/spark,dbtsai/spark,holdenk/spark,facaiy/spark,ajaysaini725/spark,ueshin/apache-spark,sureshthalamati/spark,jkbradley/spark,andrewor14/spark,rednaxelafx/apache-spark,rekhajoshm/spark,joseph-torres/spark,caneGuy/spark,zuotingbing/spark,darionyaphet/spark,janewangfb/spark,facaiy/spark,ron8hu/spark,panfengfeng/spark,rekhajoshm/spark,aokolnychyi/spark,wzhfy/spark,Aegeaner/spark,chuckchen/spark,rednaxelafx/apache-spark,panfengfeng/spark,mike0sv/spark,dongjoon-hyun/spark,JerryLead/spark,actuaryzhang/spark,nlalevee/spark,srowen/spark,nlalevee/spark,ericvandenbergfb/spark,pgandhi999/spark,ajaysaini725/spark,guoxiaolongzte/spark,milliman/spark,spark-test/spark,dhruve/spark,xflin/spark,zuotingbing/spark,narahari92/spark,andrewor14/iolap,big-pegasus/spark,yanboliang/spark,narahari92/spark,poffuomo/spark,someorz/spark,jiangxb1987/spark,saturday-shi/spark,haowu80s/spark,joseph-torres/spark,MLnick/spark,esi-mineset/spark,highfei2011/spark,apache/spark,rednaxelafx/apache-spark,map222/spark,dongjoon-hyun/spark,szhem/spark,gioenn/xSpark,huang1900/spark,zhouyejoe/spark,shubhamchopra/spark,tejasapatil/spark,big-pegasus/spark,ueshin/apache-spark,wangmiao1981/spark,milliman/spark,saltstar/spark,mahak/spark,map222/spark,michalsenkyr/spark,witgo/spark,jlopezmalla/spark,ajaysaini725/spark,big-pegasus/spark,caneGuy/spark,ajaysaini725/spark,zzcclp/spark,holdenk/spark,highfei2011/spark,janewangfb/spark,kevinyu98/spark,mdespriee/spark,andrewor14/spark,sahilTakiar/spark,saltstar/spark,goldmedal/spark,WeichenXu123/spark,dbtsai/spark,jianran/spark,jkbradley/spark,pronix/spark,SHASHANKB/spark,WeichenXu123/spark,markhamstra/spark,ahnqirage/spark,map222/spark,gengliangwang/spark,ibm-research-ireland/sparkoscope,minixalpha/spark,kissmetrics/spark,SnappyDataInc/spark,ConeyLiu/spark,rikima/spark,icexelloss/spark,liyichao/spark,dhruve/spark,SnappyDataInc/spark,highfei2011/spark,zzcclp/spark,alunarbeach/spark,szhem/spark,1haodian/spark,xuanyuanking/spark,debugger87/spark,ahnqirage/spark,1haodian/spark,shuangshuangwang/spark,zero323/spark,haowu80s/spark,aray/spark,cin/spark,techaddict/spark,huang1900/spark,goldmedal/spark,aosagie/spark,zero323/spark,UndeadBaneGitHub/spark,andrewor14/iolap,debugger87/spark,SHASHANKB/spark,sachintyagi22/spark,maropu/spark,saltstar/spark,pronix/spark,debugger87/spark,pgandhi999/spark,lxsmnv/spark,bravo-zhang/spark,sahilTakiar/spark,techaddict/spark,minixalpha/spark,MLnick/spark,big-pegasus/spark,metamx/spark,lvdongr/spark,big-pegasus/spark,mzl9039/spark,aosagie/spark,highfei2011/spark,zzcclp/spark,ueshin/apache-spark,shuangshuangwang/spark,LantaoJin/spark,zzcclp/spark,huang1900/spark,aosagie/spark,sureshthalamati/spark,pgandhi999/spark,hhbyyh/spark,ddna1021/spark,wangyum/spark,mzl9039/spark,taroplus/spark,actuaryzhang/spark,poffuomo/spark,nchammas/spark,shaneknapp/spark,goldmedal/spark,pgandhi999/spark,ConeyLiu/spark,aray/spark,spark-test/spark,WindCanDie/spark,sureshthalamati/spark,jlopezmalla/spark,cin/spark,lxsmnv/spark,markhamstra/spark,lvdongr/spark,hvanhovell/spark,brad-kaiser/spark,WeichenXu123/spark,Panos-Bletsos/spark-cost-model-optimizer,zero323/spark,WeichenXu123/spark,ConeyLiu/spark,caneGuy/spark,1haodian/spark,cin/spark,rikima/spark,zhouyejoe/spark,mzl9039/spark,janewangfb/spark,ibm-research-ireland/sparkoscope,adrian-ionescu/apache-spark,debugger87/spark,aray/spark,Panos-Bletsos/spark-cost-model-optimizer,wangyum/spark,andrewor14/spark,jrshust/spark,rezasafi/spark,esi-mineset/spark,bravo-zhang/spark,BryanCutler/spark,rednaxelafx/apache-spark,poffuomo/spark,eyalfa/spark,kissmetrics/spark,vinodkc/spark,joseph-torres/spark,jrshust/spark,tengpeng/spark,caneGuy/spark,UndeadBaneGitHub/spark,maropu/spark,tejasapatil/spark,setjet/spark,jiangxb1987/spark,sachintyagi22/spark,facaiy/spark,andrewor14/spark,ibm-research-ireland/sparkoscope,ericvandenbergfb/spark,ptkool/spark,maropu/spark,pronix/spark,kimoonkim/spark,rezasafi/spark,bdrillard/spark,icexelloss/spark,ericvandenbergfb/spark,rezasafi/spark,patrick-nicholson/spark,patrick-nicholson/spark,nchammas/spark,cloud-fan/spark,sureshthalamati/spark,jiangxb1987/spark,shubhamchopra/spark,SnappyDataInc/spark,guoxiaolongzte/spark,goldmedal/spark,gengliangwang/spark,vinodkc/spark,JerryLead/spark,ron8hu/spark,nchammas/spark,skonto/spark,janewangfb/spark,jlopezmalla/spark,publicRoman/spark,rezasafi/spark,bravo-zhang/spark,bOOm-X/spark,lvdongr/spark,someorz/spark,ioana-delaney/spark,srowen/spark,spark-test/spark,taroplus/spark,janewangfb/spark,ddna1021/spark,narahari92/spark,xuanyuanking/spark,apache/spark,markhamstra/spark,highfei2011/spark,nlalevee/spark,andrewor14/spark,patrick-nicholson/spark,taroplus/spark,aray/spark,facaiy/spark,darionyaphet/spark,apache/spark,ahnqirage/spark,UndeadBaneGitHub/spark,jianran/spark,dbtsai/spark,ptkool/spark,ConeyLiu/spark,nilsgrabbert/spark,shaneknapp/spark,spark-test/spark,skonto/spark,BryanCutler/spark,aosagie/spark,saltstar/spark,milliman/spark,dbtsai/spark,loneknightpy/spark,kimoonkim/spark,wangmiao1981/spark,eyalfa/spark,wangmiao1981/spark,andrewor14/spark,huang1900/spark,rikima/spark,mzl9039/spark,SnappyDataInc/spark,vinodkc/spark,shuangshuangwang/spark,wzhfy/spark,bravo-zhang/spark,zero323/spark,alunarbeach/spark,ron8hu/spark,szhem/spark,bOOm-X/spark,ajaysaini725/spark,szhem/spark,milliman/spark,zero323/spark,poffuomo/spark,rikima/spark,markhamstra/spark,Aegeaner/spark,liyichao/spark,liutang123/spark,ibm-research-ireland/sparkoscope,rekhajoshm/spark,hvanhovell/spark,nchammas/spark,gioenn/xSpark,kiszk/spark,minixalpha/spark,shaneknapp/spark,saturday-shi/spark,gengliangwang/spark,ioana-delaney/spark,hhbyyh/spark,patrick-nicholson/spark,dongjoon-hyun/spark,ericvandenbergfb/spark,andrewor14/iolap,zzcclp/spark,lvdongr/spark,techaddict/spark,xflin/spark,wangyum/spark,SHASHANKB/spark,dhruve/spark,cin/spark,actuaryzhang/spark,liutang123/spark,ericvandenbergfb/spark,lxsmnv/spark,panfengfeng/spark,sachintyagi22/spark,saturday-shi/spark,tejasapatil/spark,shuangshuangwang/spark,haowu80s/spark,ConeyLiu/spark,jrshust/spark,kimoonkim/spark,rezasafi/spark,eyalfa/spark,taroplus/spark,icexelloss/spark,ioana-delaney/spark,nlalevee/spark,ioana-delaney/spark,patrick-nicholson/spark,goldmedal/spark,kissmetrics/spark,tengpeng/spark,mdespriee/spark,joseph-torres/spark,saturday-shi/spark,sureshthalamati/spark,someorz/spark,alunarbeach/spark,icexelloss/spark,gioenn/xSpark,highfei2011/spark,apache-spark-on-k8s/spark,alunarbeach/spark,rednaxelafx/apache-spark,ioana-delaney/spark,ron8hu/spark,LantaoJin/spark,someorz/spark,cloud-fan/spark,JoshRosen/spark,LantaoJin/spark,aokolnychyi/spark,SnappyDataInc/spark,JoshRosen/spark,big-pegasus/spark,actuaryzhang/spark,skonto/spark,yanboliang/spark,1haodian/spark,stanzhai/spark,brad-kaiser/spark,WindCanDie/spark,jlopezmalla/spark,shaneknapp/spark,nilsgrabbert/spark,sachintyagi22/spark,ptkool/spark,poffuomo/spark,milliman/spark,loneknightpy/spark,michalsenkyr/spark,minixalpha/spark,gioenn/xSpark,mzl9039/spark,xflin/spark,techaddict/spark,zhouyejoe/spark,UndeadBaneGitHub/spark,jlopezmalla/spark,spark-test/spark,LantaoJin/spark,actuaryzhang/spark,aosagie/spark,facaiy/spark,apache-spark-on-k8s/spark,ron8hu/spark,aokolnychyi/spark,gioenn/xSpark,taroplus/spark,haowu80s/spark,liyichao/spark,wangmiao1981/spark,saltstar/spark,minixalpha/spark,rezasafi/spark,darionyaphet/spark,BryanCutler/spark,chuckchen/spark,gioenn/xSpark,jkbradley/spark,nchammas/spark,esi-mineset/spark,pgandhi999/spark,zhouyejoe/spark,dongjoon-hyun/spark,ueshin/apache-spark,jrshust/spark,srowen/spark,JoshRosen/spark,map222/spark,sachintyagi22/spark,metamx/spark,JerryLead/spark,jiangxb1987/spark,chuckchen/spark,JoshRosen/spark,debugger87/spark,liutang123/spark,jrshust/spark