Cov txheej txheem:

Cov lus txib twg yog siv rau kev hla kev xeem hauv Maven?
Cov lus txib twg yog siv rau kev hla kev xeem hauv Maven?

Video: Cov lus txib twg yog siv rau kev hla kev xeem hauv Maven?

Video: Cov lus txib twg yog siv rau kev hla kev xeem hauv Maven?
Video: Zeb Muas - Foom Kom txiv tej lus kub (Nkauj Tawm Tshiab 2021 - 2022) 2024, Hlis ntuj nqeg
Anonim

Hla khiav lub kuaj rau ib qhov project tshwj xeeb, teeb tsa cov cuab yeej skipTests kom muaj tseeb. Koj tuaj yeem ua tau hla cov kev xeem via cov lus txib kab los ntawm kev ua raws li hauv qab no lus txib : mvn nruab -DskipTests.

Tsuas yog li ntawd, cov lus txib twg yog siv rau kev kuaj xyuas kev hloov kho hauv Maven?

Txhim kho Check rau JUnit 4. junit4. upgrade check. Qhov no yuav ua tau ib kuaj thiab ceeb toom rau koj txog ib qho kev xeem tsis raug uas yuav tsis ua haujlwm nrog Surefire version no (thiab qhov tsim tsis tau). Qhov no tsuas yog txhais tau tias yog siv raws li lub cuab yeej thaum kho dua tshiab los kuaj tias txhua qhov kev sim siab yuav raug ua tiav.

Tsis tas li ntawd, DskipTests hauv Maven yog dab tsi? - DskipTests compiles cov kev xeem, tab sis skips khiav lawv. -Dmaven.test.skip=true skips compiling cov kev xeem thiab tsis khiav lawv. Tsis tas li qhov no yuav yog qhov tseem ceeb. mav .test.skip tau qhuas los ntawm Surefire, Failsafe thiab Compiler Plugin.

Tsuas yog li ntawd, kuv yuav ua li cas thiaj li tsis quav ntsej qhov kev sim hauv Maven?

Maven - Yuav ua li cas hla chav kuaj

  1. maven.test.skip=true. 1.1 Txhawm rau hla chav ntsuas, siv qhov kev sib cav no -Dmaven.test.skip=true. Terminal. $ mvn pob -Dmaven.test.skip=true #no test.
  2. Maven Surefire Plugin. 2.1 Xwb, siv qhov no -DskipTests hauv surefire plugin. Terminal.
  3. Maven Profile. 3.1 Tsim ib qho kev cai profile kom hla lub chav kuaj. pom xml.

Yuav ua li cas kuv hla kev xeem nyob rau hauv dab noj hnub?

Yuav ua li cas hla maven chav kuaj hauv dab noj hnub

  1. Tau txais koj qhov project hauv paus hauv txoj cai nyem.
  2. Yuav tsum khiav raws li thiab nyem rau ntawm kev teeb tsa.
  3. Nyob rau sab laug, mus rau Maven Build, right click thiab tsim tshiab.
  4. Xaiv koj qhov project hauv paus, muab lub npe.
  5. nyob rau hauv cov hom phiaj textfield, ntxiv koj hom kev tsim thiab ntxiv cov tsis -DskipTests = tseeb -Dmaven. xeem. ua tsis tiav. ignore = tseeb.

Pom zoo: