Dab tsi yog muab kev vam khom hauv Maven?
Dab tsi yog muab kev vam khom hauv Maven?

Video: Dab tsi yog muab kev vam khom hauv Maven?

Video: Dab tsi yog muab kev vam khom hauv Maven?
Video: Leng Yang - Yog Vim Dab Tsi (Official Full Song | Nkauj Tawm Tshiab) 2020/05/24 2024, Hlis ntuj nqeg
Anonim

Maven dependency Scope – muab

Maven dependency Scope muab yog siv thaum tsim thiab sim qhov project. Lawv kuj yuav tsum tau khiav, tab sis yuav tsum tsis txhob exported, vim hais tias cov kev vam khom yuav yog muab los ntawm lub sijhawm ua haujlwm, piv txwv li, los ntawm servlet thawv lossis daim ntawv thov server

Dhau li ntawm no, kev vam khom hauv Maven yog dab tsi?

Hauv Maven , kev vam khom yog lwm cov ntaub ntawv-JAR, ZIP, thiab lwm yam-uas koj qhov project tam sim no xav tau txhawm rau sau, tsim, sim, thiab / lossis khiav. Cov kev vam khom tau sib sau ua ke hauv pom . Yog tias lawv tsis nyob ntawd, ces Maven yuav rub tawm lawv los ntawm qhov chaw khaws cia tej thaj chaw deb thiab khaws cia rau hauv qhov chaw cia khoom hauv zos.

Kuj Paub, Dab tsi yog kev siv ntawm kev cais tawm hauv Maven? Kev cais tawm tau teem rau ntawm ib qho kev vam khom tshwj xeeb hauv koj lub POM, thiab tau tsom mus rau ib pawg tshwj xeeb Id thiab artifactId. Thaum koj tsim koj qhov project, cov artifact yuav tsis muab ntxiv rau koj qhov project classpath los ntawm txoj kev nyob rau hauv uas lub cais tawm tau tshaj tawm.

Cov lus nug tseem yog, qhov muab txhais li cas hauv Maven?

compile Qhov no yog qhov default scope, siv yog tias tsis muaj qhov teev tseg. Compile dependencies muaj nyob rau hauv tag nrho cov classpaths ntawm ib qhov project. Tsis tas li ntawd, cov kev vam khom no tau nthuav tawm mus rau cov haujlwm nyob. muab Qhov no zoo li kev suav sau, tab sis qhia tias koj cia siab tias JDK lossis lub thawv los muab kev cia siab ntawm lub sijhawm ua haujlwm.

Vim li cas Maven ib txwm rub tawm kev vam khom?

Maven downloads plugins thiab artifacts uas koj qhov project nyob ntawm. Maven ua qhov tseeb rub tawm artifacts los ntawm tej thaj chaw deb repositories, tab sis nws downloads cov artifact ib zaug thiab khaws ib lub zos cache. Maven tsuas yog downloads feem ntau ntawm cov no kev vam khom vim koj tau ntxiv lawv rau koj qhov project.

Pom zoo: