Skip to main content

maven commands

Command Line Reference

The following command line options are available when running Maven:
usage: maven [options] [goal [goal2 [goal3] ...]]

Options:
 -D,--define arg    Define a system property
 -E,--emacs         Produce logging information without adornments
 -P,--plugin-help   Display help on using a given plugin
 -X,--debug         Produce execution debug output
 -b,--nobanner      Suppress logo banner
 -d,--dir arg       Set effective working directory (ignored with -p or -f)
 -e,--exception     Produce exception stack traces
 -f,--find arg      Set project file and effective working directory by finding
                    the project file
 -g,--goals         Display available goals
 -h,--help          Display help information
 -i,--info          Display system information
 -o,--offline       Build is happening offline
 -p,--pom arg       Set project file
 -q,--quiet         Reduce execution output
 -u,--usage         Display help on using the current project
 -v,--version       Display version information
Typically, Maven is run with a list of goals in the order they should be executed. If no goals are specified, the default goal specified in maven.xml file. Additionally, the following switches can be specified. Note that -P, -g, -h, -i, -u and -v cause Maven to exit immediately without running any goals given.
OptionUsage
-D Defines a system property. This will take priority over any other property specified. eg. maven -Dmaven.repo.remote=http://public.planetmirror.com/pub/maven.
-E Output messages without adornments, making it more suitable for use in emacs.
-P Get help with plugins. When used without any arguments, ie. maven -P, all installed plugins are listed with a description. When a plugin name is given, the goals in that plugin are listed. eg. maven -g jar lists the goals such as jar:jar, jar:install, and so on.
-X Output full debugging information while performing the build. This can be helpful in tracing what is happening inside a plugin, or sending information to the Maven Developers about an internal bug.
-b Don't show the ASCII Art banner.
-d Set the effective working directory for running Maven in.
-e Display the stack trace for any final exception that leads to a build failure.
-f Set the effective working directory for running Maven in by searching for the closest project.xml.
-g List all goals available, both in this project and all installed plugins. Best used with grep or a pager such as less.
-h List the help commands above.
-i Show system information. Lists environment properties such as the Java version, all installed plugins and their versions, and the user's build.properties file.
-o Run in offline mode. This is equivalent to specifying the property maven.mode.online=false. Missing dependencies will cause failures, however old SNAPSHOTs will only cause a warning.
-p Specify the project file to use. By default it is project.xml in the current directory.
-q Run in quiet mode. Only errors are output. Note that some plugins do not honour this option, so it should not be considered as a silent mode.
-u Show the usage instructions for the current project. This will include the goals specified in maven.xml, and the instructions listed in the description element of the project.
-v Show the Maven version and exit.

MAVEN_OPTS

Specify additional options using the MAVEN_OPTS environment variable. It is for passing parameters to the Java VM when running Maven. For example, to increase the amount of memory to 1024 Meg for the entire run of Maven, use:
MAVEN_OPTS=-Xmx1024m
Also note that a given plug-in may have a property to set for its memory usage, such as the Javadoc plug-in's maven.javadoc.maxmemory property. This is because that particular plugin forks an additional Java VM.
For another example, set the MAVEN_OPTS to run Java in debug mode:
MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
After setting this property, run "maven cactus:test" (or whatever goal to debug) and it will block, waiting for a debug connection.
Then, in your IDE, select the "Run -> Debug" window and craete a new "Remote Java Application" configuration, passing the port set in MAVEN_OPTS (8787 in this case).
Once running this configuration in debug, the blocked Maven session will continue, enabling debugging from your IDE.

Comments

Popular posts from this blog

Properties

Appendix A. Common application properties Various properties can be specified inside your  application.properties / application.yml  file or as command line switches. This section provides a list common Spring Boot properties and references to the underlying classes that consume them. Property contributions can come from additional jar files on your classpath so you should not consider this an exhaustive list. It is also perfectly legit to define your own properties. This sample file is meant as a guide only. Do  not  copy/paste the entire content into your application; rather pick only the properties that you need. # =================================================================== # COMMON SPRING BOOT PROPERTIES # # This sample file is provided as a guideline. Do NOT copy it in its # entirety to your own application. ^^^ # =================================================================== # ---------...

Zero Conditional

Form In zero conditional sentences, the tense in both parts of the sentence is the simple present. If clause (condition) Main clause (result) If + simple present simple present If this thing happens that thing happens. As in all conditional sentences, the order of the clauses is not fixed. You may have to rearrange the pronouns and adjust punctuation when you change the order of the clauses, but the meaning is identical. In zero conditional sentences, you can replace "if" with "when", because both express general truths. The meaning will be unchanged. Examples If you heat ice, it melts. Ice melts if you heat it. When you heat ice, it melts. Ice melts when you heat it. If it rains, the grass gets wet. The grass gets wet if it rains. When it rains, the grass gets wet. The grass gets wet when it rains. Function The zero conditional is used to make statements about the real world, and often refers to general tru...

Annotations in java

Annotations are java language feature introduced in java 5 version Annotations can be used for   Automatic generation of   configuration file(Deployment descriptor(web.xml),bean classes,etc) Instead of describing the components    with the Xml file we can describe with the annotations in the   java source file itself. MetaData:- Data about the data is called as MetaData. The mainpurpose of Annotations in java apps to represent MetaData. to represent MetaData it is possible to   use comments directly. but commneted MetaData will be eliminated by   lexical-Analizer in compiler as part of compilation process,as   a result   commented meta data will be available in the respective .class files. In general to simplyfy debugging,Testing & to execute Enterprise app like web-app,distributed app we have to bring the metadata upto runtime. to achive this requirement we have to use Annotation over-comment. In general to bring MetaDa...