Dab tsi yog Dependencymanagement hauv Maven?
Dab tsi yog Dependencymanagement hauv Maven?

Video: Dab tsi yog Dependencymanagement hauv Maven?

Video: Dab tsi yog Dependencymanagement hauv Maven?
Video: Yog hmoov dab tsi - Gao Nou Kue ft. Mang Vang (Official Music Video) New song 2020 2024, Hlis ntuj nqeg
Anonim

Dependency Management . Kev tswj hwm kev vam meej yog ib tug mechanism rau centralize cov ntaub ntawv nyob rau hauv dependency. Nyob rau hauv ib qhov project multi-module, koj tuaj yeem hais qhia hauv niam txiv qhov project tag nrho cov artifact version thiab nws yuav tau txais los ntawm cov me nyuam tej yaam num. Hauv qab no peb yuav pom ib qho piv txwv uas muaj ob POMs uas txuas rau tib tus niam txiv

Ntawm no, dab tsi yog kev vam khom kev tswj hwm hauv Pom?

Zoo li koj hais; DependencyManagement yog siv los rub tag nrho cov ntaub ntawv kev vam khom rau hauv ib qho POM cov ntaub ntawv, simplifying cov ntaub ntawv nyob rau hauv tus me nyuam POM ntaub ntawv. Nws yuav pab tau thaum koj muaj ntau tus cwj pwm uas koj tsis xav rov ntaus rau hauv ntau qhov haujlwm me me.

Ib sab saum toj no, POM XML ua haujlwm li cas? Cov pom . xml cov ntaub ntawv muaj cov ntaub ntawv ntawm qhov project thiab configuration cov ntaub ntawv rau maven los tsim qhov project xws li dependencies, tsim directory, qhov chaw directory, xeem qhov chaw directory, plugin, lub hom phiaj thiab lwm yam. Maven nyeem cov pom . xml file, ces executes lub hom phiaj.

Ntawm no, dab tsi yog bom hauv Maven?

BOM sawv cev rau Bill Of Materials. A BOM yog ib hom tshwj xeeb ntawm POM uas yog siv los tswj cov versions ntawm ib qhov project dependencies thiab muab ib qho chaw nruab nrab los txhais thiab hloov kho cov versions. BOM muab qhov yooj yim ntxiv rau kev vam khom rau peb cov module yam tsis muaj kev txhawj xeeb txog cov version uas peb yuav tsum nyob ntawm.

Vim li cas kev tswj hwm kev vam meej ua tiav hauv niam txiv cov ntaub ntawv POM?

Cov kev tswj hwm kev vam meej seem yog ib tug mechanism rau centralizing kev vam khom cov ntaub ntawv. Thaum koj muaj ib txheej ntawm tej yaam num uas tau txais los ntawm ib tug ntau niam txiv , nws muaj peev xwm muab tag nrho cov ntaub ntawv hais txog lub kev vam khom nyob rau hauv kev POM thiab muaj cov ntaub ntawv yooj yim dua rau cov khoom qub hauv tus menyuam POMs.

Pom zoo: