Some of Maven's built-in variables and common sense

Source: Internet
Author: User

0, GroupId: The unique flag of the project or organization, and the configuration of the generated path is also generated by this, such as Org.myproject.mojo generated relative path is:/org/myproject/mojo

Artifactid: The generic name of the project

0.1, if you want to use a DOS window to execute the MAVEN command, in addition to the environment variables to configure MAVEN, in the root path of the DOS input : mvn-v to test whether Maven installed successfully, and then

when you switch the path to the path where the project's Pom file is located, the MAVEN command can be executed under this path.

0.2, mvn install is to carry out the packaging to the local warehouse, to the local warehouse to release this package

The package is packaged and packaged to a local target.

1. Maven built-in variable description:

    • ${BASEDIR} Project root directory
    • ${project.build.directory} build directory, default to target
    • ${project.build.outputdirectory} build process output directory, default to Target/classes
    • ${project.build.finalname} output name, default is ${project.artifactid}-${project.version}
    • ${project.packaging} package type, default to Jar
    • ${PROJECT.XXX} contents of any node of the current Pom file

2. Some commands:

    • Generate Eclipse Project files: mvn Eclipse:clean eclipse:eclipse-ddownloadsources
    • If there is an error executing the unit test, use this command to output the failed unit test and related information on the console: Mvn-dsurefire.usefile=false
    • Sometimes, when you want to debug a unit test in a project while mvn install, use this command: MVN install-dmaven.surefire.debug. Before using this command, set the breakpoint in the code you are about to debug, and then run the command. After the command executes for a while, its build process displays a message: Listening for transport dt_socket at address:5005. After you see this message, in Eclipse, in the Debug Configuration window, create a new remote Java Application,port set to 5005, and then click the "Debug" button. After that, the MVN command will continue to execute until the code that has the breakpoint is run, and then you can debug the running code in eclipse.

3. Some of the commands of the Maven jetty plugin: (data:http://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin)

    • Start: MVN jetty:run The default port number is 8080.
    • When starting, set the port number: mvn-djetty.port=9999 Jetty:run
    • Debug mode start: Mvndebug jetty:run after boot, the specific debug port will be displayed

4. Some projects have pom.xml files, but the works show is not maven works. At this point the pom command needs to be executed, first right on the project →"maven"→"enable Dependency management" the project into a MAVEN project. Then execute the pom instruction.

Some of Maven's built-in variables and common sense

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.