### Valid APT local link Source: https://maven.apache.org/doxia/references/doxia-apt.html Valid APT local link example. It starts with './' to distinguish it from an internal link. ```text {{{./doc/standalone.html}Standalone}} ``` -------------------------------- ### Surefire includesFile example Source: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html Example content for the `includesFile` parameter, showing path, simple, and regex include patterns. Blank lines and lines starting with # are ignored. ```text */test/* **/NotIncludedByDefault.java %regex[.*Test.*|.*Not.*] ``` -------------------------------- ### Example output of mvn --version Source: https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html Sample output showing the Maven version, Java version, and OS details. Actual output may vary based on your installation. ```text Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: D:\apache-maven-3.6.3\apache-maven\bin.. Java version: 1.8.0_232, vendor: AdoptOpenJDK, runtime: C:\Program Files\AdoptOpenJDK\jdk-8.0.232.09-hotspot\jre Default locale: en_US, platform encoding: Cp1250 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows" ``` -------------------------------- ### Invalid APT local link Source: https://maven.apache.org/doxia/references/doxia-apt.html Invalid APT local link example. It does not start with './' or '../', so it is not recognized as a local link. ```text {{{doc/standalone.html}Standalone}} ``` -------------------------------- ### StarTeam SCM connection Source: https://maven.apache.org/xsd/maven-v3_0_0.xsd Example of an SCM connection string for StarTeam access. ```text scm:starteam:username:password@host:port/project/view/directory ``` -------------------------------- ### Apache project CVS SCM connection Source: https://maven.apache.org/xsd/maven-v3_0_0.xsd Example of a typical CVS SCM connection for an Apache project. ```text scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:module-name ``` -------------------------------- ### SCM connection format using CVS NT and ntserver Source: https://maven.apache.org/xsd/maven-v3_0_0.xsd Shows an example using CVS NT and ntserver protocol: scm|cvs|ntserver|user@server|e:\cvs|Deployment. Note the use of vertical bars as delimiters because the repository path contains a colon. ```text scm|cvs|ntserver|user@server|e:\cvs|Deployment ``` -------------------------------- ### CVS pserver SCM connection with pipe delimiter Source: https://maven.apache.org/xsd/maven-v3_0_0.xsd Example showing an alternative delimiter (pipe) for CVS pserver connections, useful for Windows users with colons in the cvsroot. ```text scm|cvs|pserver|user@host|/cvs/root|module-name ``` -------------------------------- ### Specify parent project location with Source: https://maven.apache.org/xsd/maven-v3_0_0.xsd The element defines the location of the parent project. The path may be absolute or relative to the current project.xml file. This example uses a relative path from the basedir. ```XML ${basedir}/../project.xml ``` -------------------------------- ### Configure Flatten Maven Plugin in pom.xml Source: https://maven.apache.org/guides/mini/guide-maven-ci-friendly.html Required setup for installing or deploying CI-friendly artifacts. Without this plugin, installed artifacts are not consumable by Maven. The example shows the plugin configuration with updatePomFile set to true and flattenMode set to resolveCiFriendliesOnly, plus executions for flatten and clean. ```xml 4.0.0 org.apache apache 18 org.apache.maven.ci ci-parent First CI Friendly ${revision} ... 1.0.0-SNAPSHOT org.codehaus.mojo flatten-maven-plugin 1.1.0 true resolveCiFriendliesOnly flatten process-resources flatten flatten.clean clean clean child1 .. ``` -------------------------------- ### Create a shell with example credentials Source: https://maven.apache.org/plugins/maven-site-plugin/examples/site-deploy-to-sourceforge.net.html Example command and output for creating a shell on shell.sourceforge.net using the qifcon project and user barrie. The output shows the shell creation process and the interactive prompt. ```bash $ ssh -t barrie,qifcon@shell.sf.net create barrie,qifcon@shell.sf.net's password: Requesting a new shell for "barrie" and waiting for it to start. queued... creating... starting... This is an interactive shell created for user barrie,qifcon. Use the "timeleft" command to see how much time remains before shutdown. Use the "shutdown" command to destroy the shell before the time limit. For path information and login help, type "sf-help". -bash-3.2$ ``` -------------------------------- ### groupId examples Source: https://maven.apache.org/guides/mini/guide-naming-conventions.html Valid groupId examples following Java package name rules, starting with a reversed domain name you control. ```text org.apache.maven org.apache.commons com.google.guava ``` -------------------------------- ### Full APT syntax example Source: https://maven.apache.org/doxia/references/apt-format.html A comprehensive example of the APT format showing headings, paragraphs, lists, verbatim blocks, tables, horizontal lines, page breaks, font styles, links, line breaks, non-breaking spaces, escaped characters, and comments. ```apt ------ Title ------ Author ------ Date Paragraph 1, line 1. Paragraph 1, line 2. Paragraph 2, line 1. Paragraph 2, line 2. Section title * Sub-section title ** Sub-sub-section title *** Sub-sub-sub-section title **** Sub-sub-sub-sub-section title * List item 1. * List item 2. Paragraph contained in list item 2. * Sub-list item 1. * Sub-list item 2. * List item 3. Force end of list: [] +------------------------------------------+ Verbatim text not contained in list item 3 +------------------------------------------+ [[1]] Numbered item 1. [[A]] Numbered item A. [[B]] Numbered item B. [[2]] Numbered item 2. List numbering schemes: [[1]], [[a]], [[A]], [[i]], [[I]]. [Defined term 1] of definition list. [Defined term 2] of definition list. +-------------------------------+ Verbatim text as source code +-------------------------------+ --- instead of +-- marks the block as plain text rather than source code. [Figure name] Figure caption *----------*--------------+----------------: | Centered | Left-aligned | Right-aligned | | cell 1,1 | cell 1,2 | cell 1,3 | *----------*--------------+----------------: | cell 2,1 | cell 2,2 | cell 2,3 | *----------*--------------+----------------: Table caption No grid, no caption: *-----*------* cell | cell *-----*------* cell | cell *-----*------* Horizontal line: ======================================================================= ^L New page. font. <> font. <<>> font. {Anchor}. Link to {{anchor}}. Link to {{http://www.pixware.fr}}. Link to {{{anchor}showing alternate text}}. Link to {{{http://www.pixware.fr}Pixware home page}}. Force line\ break. Non\ breaking\ space. Escaped special characters: \~, \=, \-, \+, \*, \[, \], \<, \>, \{, \}, \\. Copyright symbol: \251, \xA9, \u00a9. ~~Commented out. ``` -------------------------------- ### Setup values for HTTPS repository access Source: https://maven.apache.org/guides/mini/guide-repository-ssl.html File paths, password, and Maven repository property used in the guide's setup. ```text /somewhere/in/filesystem/CACert.cert ``` ```text /home/directory/mycertificate.p12 ``` ```text CeRtPwD ``` ```text maven.repo.remote=https://my.server.com/maven,http://www.ibiblio.org/maven ``` -------------------------------- ### Configure site URL in pom.xml with example project Source: https://maven.apache.org/plugins/maven-site-plugin/examples/site-deploy-to-sourceforge.net.html Example pom.xml configuration for the qifcon project, using scp://shell.sourceforge.net/home/project-web/qifcon/htdocs as the site URL. ```xml 1. ... 2. 3. ... 4. 5. qifcon.sf.net 6. scp://shell.sourceforge.net/home/project-web/qifcon/htdocs 7. 8. 9. ... ``` -------------------------------- ### Verify Maven installation with mvn -v Source: https://maven.apache.org/install.html Run mvn -v in a new shell to confirm Maven is installed. The output should resemble the example shown. ```bash mvn -v ``` ```text Apache Maven 3.9.16 (2bdd9fddda4b155ebf8000e807eb73fd829a51d5) Maven home: /opt/apache-maven-3.9.16 Java version: 1.8.0_45, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac" ``` -------------------------------- ### installAndDeploy(String[]) Source: https://maven.apache.org/resolver/apidocs/index-all.html Method in class org.apache.maven.resolver.examples.resolver.ResolverDemo. No description provided in the source. ```APIDOC ## [METHOD] installAndDeploy(String[]) ### Description Method in class org.apache.maven.resolver.examples.resolver.ResolverDemo. No description provided in the source. ``` -------------------------------- ### Command Line Execution Example Source: https://maven.apache.org/doxia/doxia-tools/doxia-converter/usage.html Example command to convert an XHTML file to APT format. The -from parameter can be omitted to let the converter autodetect the input format. ```bash # java -jar target/doxia-converter-1.3-jar-with-dependencies.jar \ -in /path/to/xhtml.file \ -from xhtml \ -out /path/to/outputdir \ -to apt ``` -------------------------------- ### Example groupId filter file Source: https://maven.apache.org/resolver/remote-repository-filtering.html Example file for the groupId filter. Lines starting with '#' and blank lines are ignored. Modifiers '!' (negation) and '=' (limiter) can be used. The example shows allowed and disallowed groupIds with explanations. ```text # My file (1) (2) org.apache.maven (3) !=org.apache.maven.foo (4) !org.apache.maven.indexer (5) =org.apache.bar (6) ``` -------------------------------- ### Run site with Jetty Source: https://maven.apache.org/plugins/maven-site-plugin/usage.html Starts the site in Jetty, by default on http://localhost:8080/. Only works for single-module sites; use site:stage to preview multi-module sites. ```bash mvn site:run ``` -------------------------------- ### includesFile example with path, simple and regex includes Source: https://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html Example contents of an `includesFile` where each line is an include pattern. Blank lines and lines starting with # are ignored. If `includes` are also specified, these patterns are appended. ```text */it/* **/NotIncludedByDefault.java %regex[.*IT.*|.*Not.*] ``` -------------------------------- ### Install sources JAR with maven-install-plugin install-file Source: https://maven.apache.org/plugins/maven-install-plugin/examples/installing-secondary-artifacts.html Use this command to install a secondary artifact, such as sources, by specifying the classifier parameter. The example installs commons-logging-1.0.3 sources from a local JAR file. Using the fully qualified goal path ensures the preferred plugin version is used. ```bash mvn org.apache.maven.plugins:maven-install-plugin:3.2.0:install-file -Dfile=path-to-commons-logging-sources.jar \ -DgroupId=commons-logging \ -DartifactId=commons-logging \ -Dversion=1.0.3 \ -Dpackaging=jar \ -Dclassifier=sources ``` -------------------------------- ### mvn install:help Source: https://maven.apache.org/plugins/maven-install-plugin/help-mojo.html Displays help information for the maven-install-plugin. Use the `-Ddetail=true` and `-Dgoal=` options to show parameter details for a specific goal. ```APIDOC ## [CLI] mvn install:help ### Description Displays help information for the maven-install-plugin. Use the `-Ddetail=true` and `-Dgoal=` options to show parameter details for a specific goal. ### Method CLI Command ### Command `mvn install:help` ### Parameters #### Optional Parameters - **detail** (boolean) - Optional - If `true`, display all settable properties for each goal. Default: `false`. User Property: `detail`. - **goal** (String) - Optional - The name of the goal for which to show help. If unspecified, all goals will be displayed. User Property: `goal`. - **indentSize** (int) - Optional - The number of spaces per indentation level, should be positive. Default: `2`. User Property: `indentSize`. - **lineLength** (int) - Optional - The maximum length of a display line, should be positive. Default: `80`. User Property: `lineLength`. ### Usage Example ``` mvn install:help -Ddetail=true -Dgoal= ``` ### Response Displays help information for the specified goal or all goals if no goal is specified. ``` -------------------------------- ### Example release files Source: https://maven.apache.org/developers/release/maven-project-release-procedure.html Example file names to add to the dist area: the source release bundle, its signature, and its sha512 checksum. ```text wagon/wagon-2.2-source-release.zip wagon/wagon-2.2-source-release.zip.asc wagon/wagon-2.2-source-release.zip.sha512 ``` -------------------------------- ### Archetype selection prompt example Source: https://maven.apache.org/archetype/maven-archetype-plugin/specification/archetype-catalog.html Example of the line shown by the Archetype Plugin when asking the user to choose an archetype. The index starts from 1, the catalog name is 'internal', the artifactId is 'appfuse-basic-jsf', and the description is shown in parentheses. ```text 1: internal -> appfuse-basic-jsf (AppFuse archetype for creating a web application with Hibernate, Spring and JSF) ``` -------------------------------- ### Redirect help:describe output to a file Source: https://maven.apache.org/plugins/maven-help-plugin/examples/describe-configuration.html Runs the help:describe goal with the output parameter to redirect the detailed plugin description to a file at the specified path. ```bash mvn help:describe -Dplugin=help -Ddetail=true -Doutput=/path/to/file ``` -------------------------------- ### getProtocol() - Method in class org.eclipse.aether.repository.RemoteRepository Source: https://maven.apache.org/resolver/apidocs/index-all.html Gets the protocol part from the repository's URL, for example `file` or `http`. ```APIDOC ## getProtocol() - Method in class org.eclipse.aether.repository.RemoteRepository ### Description Gets the protocol part from the repository's URL, for example `file` or `http`. ### Method GET ### Endpoint org.eclipse.aether.repository.RemoteRepository#getProtocol() ### Parameters None ### Response #### Success Response (200) - **protocol** (String) - The protocol part from the repository's URL. #### Response Example { "protocol": "http" } ``` -------------------------------- ### Sink API paragraph example Source: https://maven.apache.org/doxia/overview.html Shows the basic Sink API calls to start a paragraph, add text, and end the paragraph. The method names follow the convention where a start tag is denoted by xxxx() and an end tag by xxxx_(). ```java sink.paragraph(); sink.text( "my text" ); sink.paragraph_(); ``` -------------------------------- ### mvn help:describe -Dplugin=help (default output) Source: https://maven.apache.org/plugins/maven-help-plugin/examples/describe-configuration.html Displays a list of the plugin's mojos and their descriptions when no `minimal` or `detail` parameter is provided. The output includes the plugin's coordinates and a list of its goals, each with a description and deprecation status. ```text # mvn help:describe -Dplugin=help ... [INFO] org.apache.maven.plugins:maven-help-plugin:2.1-SNAPSHOT Group Id: org.apache.maven.plugins Artifact Id: maven-help-plugin Version: 2.1-SNAPSHOT Goal Prefix: help Description: The Maven Help plugin provides goals aimed at helping to make sense out of the build environment. It includes the ability to view the effective POM and settings files, after inheritance and active profiles have been applied, as well as a describe a particular plugin goal to give usage information. This plugin has 9 goals: help:active-profiles Description: Displays a list of the profiles which are currently active for this build. Deprecated. No reason given help:all-profiles Description: Displays a list of available profiles under the current project. Note: it will list all profiles for a project. If a profile comes up with a status inactive then there might be a need to set profile activation switches/property. Deprecated. No reason given help:describe Description: Displays a list of the attributes for a Maven Plugin and/or Mojo (Maven plain Old Java Object). Deprecated. No reason given help:effective-pom Description: Displays the effective POM as an XML for this build, with the active profiles factored in. Deprecated. No reason given help:effective-settings Description: Displays the calculated settings as XML for this project, given any profile enhancement and the inheritance of the global settings into the user-level settings. Deprecated. No reason given help:evaluate Description: Evaluates Maven expressions given by the user in an interactive mode. Deprecated. No reason given help:help Description: Display help information on maven-help-plugin. Call mvn help:help -Ddetail=true -Dgoal= to display parameter details. Deprecated. No reason given help:system Description: Displays a list of the platform details like system properties and environment variables. Deprecated. No reason given For more information, run 'mvn help:describe [...] -Ddetail' ... ``` -------------------------------- ### Example classpath output Source: https://maven.apache.org/plugins/maven-dependency-plugin/usage.html Example of a classpath string that the dependency:build-classpath goal outputs to a file or log. ```text /home/foo/.m2/repository/org/java/utils/util/util-1.0.jar:/home/foo/.m2/ .... ``` -------------------------------- ### Pre-release and build metadata version examples Source: https://maven.apache.org/guides/mini/guide-naming-conventions.html Version examples with pre-release labels (beta, M1, rc2) and build metadata (prefixed with +). Avoid dates in these labels as they are associated with unstable versions. ```text // Pre-releases 1.0.0-beta 1.0.0-M1 1.0.0-rc2 // Build metadata 1.2.3+dfc0c87 2.3.4+15433 ```