In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you the maven project install when ignoring the implementation of test example analysis, I hope you will learn something after reading this article, let's discuss it!
Ignore executing test when maven project install when mvn install-Dmaven.test.skip=true is packaged with the maven command in the root directory of the folder where the project is located
Or
In mvn install-DskipTests=truespringboot project
Add the following configuration to the pom.xml file:
True
Or
Add the following option to configure org.apache.maven.plugins maven-surefire-plugin 2.5 true to use eclipse native to the pom.xml file of the true maven project
Right click on eclipse project-- > Run As-- > Maven build... -- > enter install and check Skip Tests
This method does not perform unit tests and does not compile test classes.
Note: the class files generated in the above target/test-classes directory cannot be seen in eclipse and need to be seen in the corresponding folder.
Maven skips unit testing-the difference between maven.test.skip and skipTests and some common commands
DskipTests: do not execute the test case, but compile the test case class to generate the corresponding class file under target/test-classes.
Dmaven.test.skip=true: test cases are not executed and test case classes are not compiled.
Do not execute the test case, but compile the test case class to generate the corresponding class file to the target/test-classes.
Use maven.test.skip
Skip not only the run of the unit test, but also the compilation of the test code.
Mvn package-Dmaven.test.skip=true
You can also modify it in the pom.xml file
Org.apache.maven.plugin maven-compiler-plugin 2.1 true org.apache.maven.plugins maven-surefire-plugin 2.5 true skips unit tests using mvn package-DskipTests
However, compilation continues; if there is no time to modify the bug of the unit test, or if the unit test compiles errors. Use the one above. Don't use this.
Org.apache.maven.plugins maven-surefire-plugin 2.5 true
1. Run the unit test in the application: mvn test or mvn test-Dtest=***Test, where "* Test" is the class name of the test case (no .java is required)
Open the console and enter the directory where the test project is located: d:\ workspace-sell\ sell-qatest path; after entering the mvn test command, start executing all test scripts in sell-qatest and output the information to the console.
If you want to run a use case in a separate test class, such as publishAuctionTest.java, you can run mvn test-Dtest=publishAuctionTest
2. Clear the build result in the target directory: mvn clean (clear the contents of the taget folder)
3. Install jar:mvn install in the local repo. After running the command, the target folder is generated under the root directory of the project, and the jar package and class folder are stored in the folder. Generate the project jar package directory in the local warehouse repo.
4. Package the project: mvn package. After running the command, the target folder is generated under the root directory of the project, and the jar package and class folder are stored in the folder.
5. Generate the Eclipse project file: mvn eclipse:eclipse. After running the command, the eclipse project is generated, and the .project, .classpath files and target folders are generated in the root directory of the project. Import the project into eclipse: open eclipse, and import it into eclipse through file- > import.
6. Clear Eclipse project: mvn eclipse:clean. The .classpath and .project files are deleted.
After reading this article, I believe you have a certain understanding of "sample Analysis of ignoring the execution of test in maven Project install". If you want to know more about it, please follow the industry information channel and thank you for your reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.