How to install maven on windows

Overview about the changes

  • There had been issues related to the project discoverytime which has been increased in previous version which influenced some of our users. This should have been fixed MNG-6311, MNG-6383 and MNG-6412.

  • The output in the reactor summary has been improved MNG-6391 cause it confused people. In Maven 3.6.0 the reactor summary now looks like the following:

 ------------------------------------------------------------------------
 Reactor Summary for parent 5.0.4-SNAPSHOT:

 parent ............................................. SUCCESS 
 domain ............................................. SUCCESS 
 service-client ..................................... SUCCESS 
 webgui ............................................. SUCCESS 
 service ............................................ SUCCESS 
 app ................................................ SUCCESS 
 appasm ............................................. SUCCESS 
 shade .............................................. SUCCESS 
 assembly ........................................... SUCCESS 
 ------------------------------------------------------------------------
 BUILD SUCCESS
 ------------------------------------------------------------------------
 Total time:  6.824 s
 Finished at: 2018-11-01T12:20:16+01:00
 ------------------------------------------------------------------------

The in the above output is the artifact name of the root module and the is the versions number for all modules in this reactor build.

If you have an aggregator pom which contains different modules with different versions each line will contain the appropriate versions which looks like this:

 ------------------------------------------------------------------------
 Reactor Summary:

 Apache Maven ACR Plugin 3.0.1-SNAPSHOT ............. SUCCESS 
 Apache Maven AntRun Plugin 3.0.0-SNAPSHOT .......... SUCCESS 
 Apache Maven Changelog Plugin 2.4-SNAPSHOT ......... SUCCESS 
 Apache Maven Changes Plugin 3.0.0-SNAPSHOT ......... SUCCESS 
 Apache Maven Clean Plugin 3.0.1-SNAPSHOT ........... SUCCESS 
 Apache Maven Compiler Plugin 3.7.1-SNAPSHOT ........ SUCCESS 
 Apache Maven Deploy Plugin 3.0.0-SNAPSHOT .......... SUCCESS 
 Apache Maven Documentation Checker Plugin 1.2-SNAPSHOT SUCCESS 
 Apache Maven EAR Plugin 3.0.0-SNAPSHOT ............. SUCCESS 
 Apache Maven EJB Plugin 3.0.1-SNAPSHOT ............. SUCCESS 
...

Apache Maven PMD Plugin

The PMD Plugin allows you to automatically run the PMD code analysis tool on your project’s source code and generate a site report with its results. It also supports the separate Copy/Paste Detector tool (or CPD) distributed with PMD.

This version of Maven PMD Plugin uses PMD 6.38.0 and requires Java 8. See Upgrading PMD at Runtime for more information.

The plugin accepts configuration parameters that can be used to customize the execution of the PMD tool.

Goals Overview

This plugin has the following goals:

  • pmd:pmd creates a PMD site report based on the rulesets and configuration set in the plugin. It can also generate a pmd output file aside from the site report in any of the following formats: xml, csv or txt.
  • pmd:aggregate-pmd creates a PMD site report in an aggregator project based on the rulesets and configuration set in the plugin. It can also generate a pmd output file aside from the site report in any of the following formats: xml, csv or txt.
  • pmd:aggregate-pmd-no-fork creates a PMD site report in an aggregator project without forking the test-compile phase again.
  • pmd:cpd creates a report for PMD’s Copy/Paste Detector (CPD) tool. It can also generate a cpd results file in any of these formats: xml, csv or txt.
  • pmd:aggregate-cpd creates a report for PMD’s Copy/Paste Detector (CPD) tool in an aggregator project. It can also generate a cpd results file in any of these formats: xml, csv or txt.
  • pmd:check fails the build if there were any PMD violations in the source code. This goal invokes automatically pmd:pmd prior to executing itself.
  • pmd:aggregate-pmd-check fails the build in an aggregator project if there were any PMD violations in the source code. This goal invokes automatically pmd:aggregate-pmd prior to executing itself.
  • pmd:cpd-check fails the build if there were any CPD violations in the source code. This goal invokes automatically pmd:cpd prior to executing itself.
  • pmd:aggregate-cpd-check fails the build in an aggregator project if there were any CPD violations in the source code. This goal invokes automatically pmd:aggregate-cpd prior to executing itself.

Usage

General instructions on how to use the PMD Plugin can be found on the usage page. Some more specific use cases are described in the examples given below.

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.

Upgrading Notes

Note: Starting with PMD 6.0.0 and Maven PMD Plugin 3.9.0, the rules have been reorganized into categories, e.g. /category/java/bestpractices.xml. So when upgrading to Maven PMD Plugin 3.9.0 you should review your plugin configuration and/or custom ruleset. See Using Rule Sets for more information.

Examples

To provide you with better understanding of some usages of the Maven PMD Plugin, you can take a look into the following examples:

  • Upgrading PMD at Runtime
  • Multimodule Configuration
  • Aggregating PMD reports for Multi-Module-Projects
  • Remove Report
  • Target JDK and Toolchains
  • Using Rule Sets
  • Violation Checking
  • Analyzing JavaScript Code
  • Analyzing Java Server Pages Code
  • Finding duplicated code in C#
  • Different ruleset for tests

Reporters and Contributors of this release

We really value the contributions of these non committers, so this section is focused on those individuals. Descriptions of the issues fixed can be found at the .

Issue Reporters of this release:

  • MNG-5705 Ondra Žižka
  • MNG-5965 Matthias Schmalz
  • MNG-6059 Andreas Sewe
  • MNG-6159 Christian Aistleitner
  • MNG-6213 Jin Kwon
  • MNG-6256 Christoph Etzel
  • MNG-6261 Dawid Weiss
  • MNG-6262 Gene Smith
  • MNG-6346 Patrik Jetzer
  • MNG-6374 Rohan Padhye
  • MNG-6495 Elliotte Rusty Harold
  • MNG-6506 Andreas Veithen
  • MNG-6526 Olaf Otto
  • MNG-6529 Michael Istria
  • MNG-6530 Michael Istria
  • MNG-6533 Michael Istria
  • MNG-6543 Romain Manni-Bucau
  • MNG-6558 Guy Brand
  • MNG-6577 Rohan Padhye
  • MNG-6591 Olaf Otto
  • MNG-6605 Gunnar Wagenknecht
  • MNG-6618 Viacheslav Yakunin

Code Contributors of this release:

  • MNG-6374 Gabriel Belingueres (indirectly via plexus-utils PR)
  • MNG-6529 Michael Istria
  • MNG-6530 Michael Istria
  • MNG-6558 Guy Brand
  • MNG-6261 Fabiano C. de Oliveira
  • MNG-6533 Michael Istria

Many thanks to all reporters and contributors for their time and support.

Apache Maven Project Info Reports Plugin

The Maven Project Info Reports plugin is used to generate reports information about the project.

Goals Overview

The Project Info Reports Plugin has the following goals:

  • project-info-reports:ci-management is used to generate the Project Continuous Integration Management report.
  • project-info-reports:dependencies is used to generate the Project Dependencies report.
  • project-info-reports:dependency-convergence is used to generate the Project Dependency Convergence report for (reactor) builds.
  • project-info-reports:dependency-info is used to generate code snippets to be added to build tools.
  • project-info-reports:dependency-management is used to generate the Project Dependency Management report.
  • project-info-reports:distribution-management is used to generate the Project Distribution Management report.
  • project-info-reports:help is used to display help information on the Project Info Reports Plugin.
  • project-info-reports:index is used to generate the Project index page.
  • project-info-reports:issue-management is used to generate the Project Issue Management report.
  • project-info-reports:licenses is used to generate the Project Licenses report.
  • project-info-reports:mailing-lists is used to generate the Project Mailing Lists report.
  • project-info-reports:modules is used to generate the Project Modules report.
  • project-info-reports:plugin-management is used to generate the Project Plugin Management report.
  • project-info-reports:plugins is used to generate the Project Plugins report.
  • project-info-reports:team is used to generate the Project Team report.
  • project-info-reports:scm is used to generate the Project Source Code Management report.
  • project-info-reports:summary is used to generate the Project Summary report.

Incompatibility Notice

With the major version 3.0 several mojos and output filenames have been changed for alignment with their corresponding elements in the POM. In other words, mojos have the same names as their POM counterparts. To make you aware of that, see the following table for the upcoming changes:

Goal Name New Goal Name Output name New Output Name
cim ci-management integration.html ci-management.html
mailing-list mailing-lists mail-lists.html mailing-lists.html
project-team team team-list.html team.html
license licenses license.html licenses.html
issue-management issue-management issue-tracking.html issue-management.html
scm source-repository.html scm.html
summary project-summary.html summary.html

Details about this change can be found in MPIR-323.

Usage

General instructions on how to use the Project Info Reports Plugin can be found on the usage page. Some more specific use cases are described in the examples given below.

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.

Examples

To provide you with better understanding on some usages of the Maven Project Info Reports Plugin, you can take a look into the following examples:

  • Run Selective Reports
  • Run Individual Reports
  • Customize the SCM Report
  • Overview of the reports generated for this plugin

Apache Maven Install Plugin

The Install Plugin is used during the install phase to add artifact(s) to the local repository. The Install Plugin uses the information in the POM (groupId, artifactId, version) to determine the proper location for the artifact within the local repository.

The local repository is the local cache where all artifacts needed for the build are stored. By default, it is located within the user’s home directory (~/.m2/repository) but the location can be configured in ~/.m2/settings.xml using the <localRepository> element.

Goals Overview

The Install Plugin has 3 goals:

  • install:install is used to automatically install the project’s main artifact (the JAR, WAR or EAR), its POM and any attached artifacts (sources, javadoc, etc) produced by a particular project.
  • install:install-file is mostly used to install an externally created artifact into the local repository, along with its POM. In that case the project information can be taken from an optionally specified pomFile, but can also be given using command line parameters.
  • install:help displays help information on maven-install-plugin.

Important Note for Version 3.0.0+

The install:install goal does not support creating checksums anymore via -DcreateChecksum=true cause this option has been removed. Details can be found in MINSTALL-143.

Usage

General instructions on how to use the Install Plugin can be found on the usage page. Some more specific use cases are described in the examples given below.

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.

Examples

To provide you with better understanding on some usages of the Maven Install Plugin, you can take a look into the following examples:

  • Installing a Custom POM
  • Generating a Generic POM
  • Creating Checksums
  • Updating Release Info
  • Installing an Artifact to a Specific Local Repository Path
  • Installing Secondary Artifacts

Known Issues

  • New attributes for URLs inheritance (see ) are not yet accepted during POM structure control on upload to the Central Repository: see MVNCENTRAL-4841 to track progress
  • If you are using Maven reporting, it might happen that you will get an exception which looks like this:
 Scanning for projects...
 Internal error: java.lang.NullPointerException -> 
org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
...
Caused by: java.lang.NullPointerException
    at org.apache.maven.model.plugin.DefaultReportingConverter.convert (DefaultReportingConverter.java:243)
...

This is caused by using a which does not contain a element.

Temporarily this issue can circumvented by adding an empty element inside the .

Dependency File Details

Filename Size Entries Classes Packages Java Version Debug Information
jsr305-3.0.2.jar 19.9 kB 46 35 3 1.5 Yes
error_prone_annotations-2.3.4.jar 13.9 kB 34 22 2 1.7 No
failureaccess-1.0.1.jar 4.6 kB 15 2 1 1.7 Yes
guava-28.2-android.jar 2.6 MB 1922 1892 18 1.7 Yes
listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar 2.2 kB 7 No
j2objc-annotations-1.3.jar 8.8 kB 23 12 1 1.5 Yes
commons-codec-1.11.jar 335 kB 243 96 7 1.6 Yes
commons-io-2.6.jar 214.8 kB 146 127 7 1.7 Yes
junit-4.13.jar 381.8 kB 387 348 32 1.5 Yes
commons-lang3-3.7.jar 499.6 kB 295 270 13 1.7 Yes
maven-aether-provider-3.0.jar 51.2 kB 38 21 1 1.5 Yes
maven-artifact-3.0.jar 51.9 kB 57 32 11 1.5 Yes
maven-core-3.0.jar 527 kB 406 332 39 1.5 Yes
maven-model-3.0.jar 164.7 kB 67 50 3 1.5 Yes
maven-model-builder-3.0.jar 148 kB 142 109 16 1.5 Yes
maven-plugin-api-3.0.jar 48.9 kB 46 25 6 1.5 Yes
maven-repository-metadata-3.0.jar 30.1 kB 25 7 2 1.5 Yes
maven-settings-3.0.jar 46.7 kB 33 17 2 1.5 Yes
maven-settings-builder-3.0.jar 37.8 kB 49 28 5 1.5 Yes
maven-plugin-annotations-3.5.2.jar 14.3 kB 22 7 1 1.6 Yes
maven-artifact-transfer-0.12.0.jar 120.3 kB 118 80 21 1.7 Yes
maven-common-artifact-filters-3.0.1.jar 61.5 kB 62 43 4 1.6 Yes
maven-dependency-tree-3.0.1.jar 36.7 kB 41 20 4 1.6 Yes
maven-shared-utils-3.1.0.jar 163.7 kB 107 82 10 1.6 Yes
checker-compat-qual-2.5.5.jar 5.9 kB 17 10 1 1.6 No
plexus-classworlds-2.2.3.jar 46.1 kB 51 36 5 1.4 Yes
plexus-component-annotations-2.0.0.jar 4.2 kB 15 3 1 1.6 No
plexus-interpolation-1.14.jar 61.1 kB 60 44 6 1.4 Yes
plexus-utils-3.3.0.jar 263.3 kB 130 105 9 1.6 Yes
aether-util-0.9.0.M2.jar 133.6 kB 118 93 13 1.5 Yes
hamcrest-core-1.3.jar 45 kB 52 45 3 1.5 Yes
jdom2-2.0.6.jar 304.9 kB 215 195 15 1.5 Yes
mockito-all-1.9.5.jar 1.6 MB 1372 698 74 1.5 Yes
asm-8.0.jar 121.7 kB 44 38 3 Yes
asm-analysis-8.0.jar 33.4 kB 22 15 2 Yes
asm-commons-8.0.jar 71.6 kB 34 28 2 Yes
asm-tree-8.0.jar 52.6 kB 45 39 2 Yes
asm-util-8.0.jar 84.7 kB 31 25 2 Yes
slf4j-api-1.7.5.jar 26.1 kB 34 23 3 1.5 Yes
aether-api-1.7.jar 74.2 kB 102 82 11 1.5 Yes
aether-impl-1.7.jar 106.3 kB 72 58 2 1.5 Yes
aether-spi-1.7.jar 13.5 kB 31 16 4 1.5 Yes
aether-util-1.7.jar 107.9 kB 101 78 13 1.5 Yes
plexus-cipher-1.4.jar 13.5 kB 20 6 1 1.4 Yes
plexus-sec-dispatcher-1.3.jar 28.6 kB 31 13 3 1.4 Yes
sisu-guice-2.1.7-noaop.jar 471.7 kB 416 402 8 1.5 Yes
sisu-inject-bean-1.4.2.jar 153 kB 165 138 13 1.5 Yes
sisu-inject-plexus-1.4.2.jar 201.7 kB 199 156 26 1.5 Yes
jdependency-2.4.0.jar 180 kB 92 66 7 1.8 Yes
xmlunit-1.6.jar 101.2 kB 80 71 5 1.3 Yes
Total Size Entries Classes Packages Java Version Debug Information
50 9.9 MB 7880 6140 443 1.8 46
compile: 43 compile: 7.7 MB compile: 5914 compile: 4947 compile: 326 compile: 40
test: 4 test: 2.1 MB test: 1891 test: 1162 test: 114 test: 4
runtime: 1 runtime: 51.2 kB runtime: 38 runtime: 21 runtime: 1 runtime: 1
provided: 2 provided: 18.5 kB provided: 37 provided: 10 provided: 2 provided: 1

Feature Summary

The following are the key features of Maven in a nutshell:

  • Simple project setup that follows best practices — get a new project or module started in seconds
  • Consistent usage across all projects — means no ramp up time for new developers coming onto a project
  • Superior dependency management including automatic updating, dependency closures (also known as transitive dependencies)
  • Able to easily work with multiple projects at the same time
  • A large and growing repository of libraries and metadata to use out of the box, and arrangements in place with the largest Open Source projects for real-time availability of their latest releases
  • Extensible, with the ability to easily write plugins in Java or scripting languages
  • Instant access to new features with little or no extra configuration
  • Ant tasks for dependency management and deployment outside of Maven
  • Model based builds: Maven is able to build any number of projects into predefined output types such as a JAR, WAR, or distribution based on metadata about the project, without the need to do any scripting in most cases.
  • Coherent site of project information: Using the same metadata as for the build process, Maven is able to generate a web site or PDF including any documentation you care to add, and adds to that standard reports about the state of development of the project. Examples of this information can be seen at the bottom of the left-hand navigation of this site under the «Project Information» and «Project Reports» submenus.
  • Release management and distribution publication: Without much additional configuration, Maven will integrate with your source control system (such as Subversion or Git) and manage the release of a project based on a certain tag. It can also publish this to a distribution location for use by other projects. Maven is able to publish individual outputs such as a JAR, an archive including other dependencies and documentation, or as a source distribution.
  • Dependency management: Maven encourages the use of a central repository of JARs and other dependencies. Maven comes with a mechanism that your project’s clients can use to download any JARs required for building your project from a central JAR repository much like Perl’s CPAN. This allows users of Maven to reuse JARs across projects and encourages communication between projects to ensure that backward compatibility issues are dealt with.

Пошаговая установка Maven

. Минимально необходимое свободное место на диске — 500 Мб.

2. Распакованный архив переместите в удобную для вас директорию. В Windows путь к Maven может выглядеть как C:\Program Files\maven\, в Linux — /opt/maven.

3. Введите mvn -version в командную строку, чтобы проверить корректность установки фреймворка.

4. Далее создайте новый проект в IntelliJIDEA.

Создание нового проекта

5. Заполните поля в появившемся диалоговом окне.

Заполните поля в диалоговом окне

Проект также можно создать в удобном для вас месте. Его структура выглядит так:

  • pom.xml — файл, который полностью управляет фреймворком Maven;
  • src/main/java — папка, в которой находятся все Java-классы;
  • src/main/resources — папка, в которой находятся таблицы стилей, веб-страницы, изображения, используемые приложением.

Проект можно создать в удобном для вас месте

Apache Maven Deploy Plugin

The deploy plugin is primarily used during the deploy phase, to add your artifact(s) to a remote repository for sharing with other developers and projects. This is usually done in an integration or release environment. It can also be used to deploy a particular artifact (e.g. a third party jar like Sun’s non redistributable reference implementations).

As a repository contains more than the artifacts (POMs, the metadata, MD5 and SHA1 hash files…), deploying means not only copying the artifacts, but making sure all this information is correctly updated. It’s the reponsibility of the deploy plugin.

To work, the deployment will require:

  • information about the repository: its location, the transport method used to access it (FTP, SCP, SFTP…) and the optional user specific required account information
  • information about the artifact(s): the group, artifact, version, packaging, classifier…
  • a deployer: a method to actually perform the deployment. This can be implemented as a wagon transport (making it cross-platform), or use a system specific method.

The information will be taken from the implied (or specified) pom and from the command line. The settings.xml file may also be parsed to retrieve user credentials.

Goals Overview

The deploy plugin has 2 goals:

  • deploy:deploy is used to automatically install the artifact, its pom and the attached artifacts produced by a particular project. Most if not all of the information related to the deployment is stored in the project’s pom.
  • deploy:deploy-file is used to install a single artifact along with its pom. In that case the artifact information can be taken from an optionally specified pomFile, but can be completed/overriden using the command line.

Major Version Upgrade to version 3.0.0

Please note that the following parameter has been completely removed from the plugin configuration:

uniqueVersion

As of Maven 3, snapshot artifacts will always be deployed using a timestamped version.

Usage

General instructions on how to use the Deploy Plugin can be found on the usage page. Some more specific use cases are described in the examples given below.

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.

Examples

To provide you with better understanding on some usages of the deploy plugin, you can take a look into the following examples:

Project Deployment:

  • Deployment with FTP
  • Deployment with external SSH

File Deployment:

  • Disable the generation of pom
  • Deploy an artifact with a customed pom
  • Deploy an artifact with classifier
  • Disable timestamps suffix in an artifact
  • Deploy an artifact in legacy layout

Single Project Setup

This can look like this:

<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>18</version>
  </parent>
  <groupId>org.apache.maven.ci</groupId>
  <artifactId>ci-parent</artifactId>
  <name>First CI Friendly</name>
  <version>${revision}</version>
  ...
</project>

This is of course a simple situation where we use only for brevity to show the general course.

Based on the above pom you can build your project using:

mvn clean package

But wait there is a problem? Which version will the artifacts have? So you need to define the version for your artifacts. The first possibility is to use the command line like this:

mvn -Drevision=1.0.0-SNAPSHOT clean package

This will become cumbersome over the time. So the other solution for this is to simply use a property inside the pom file which looks like this:

<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>18</version>
  </parent>
  <groupId>org.apache.maven.ci</groupId>
  <artifactId>ci-parent</artifactId>
  <name>First CI Friendly</name>
  <version>${revision}</version>
  ...
  <properties>
    <revision>1.0.0-SNAPSHOT</revision>
  </properties>
</project>

So now you can simply call Maven as usual like .

You can of course change the version via the command line like this:

mvn -Drevision=2.0.0-SNAPSHOT clean package

Of course you can use the file for this.

A note about the used properties. You can only use those named , and/or and not other named properties like this:

<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>18</version>
  </parent>
  <groupId>org.apache.maven.ci</groupId>
  <artifactId>ci-parent</artifactId>
  <name>First CI Friendly</name>
  <version>${revision}</version>
  ...
  <properties>
    <revision>1.0.0-${buildNumber}-SNAPSHOT</revision>
  </properties>
</project>

The above example will not work as expected. If you like to have more flexibility you can use a combination of the different properties like this:

<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>18</version>
  </parent>
  <groupId>org.apache.maven.ci</groupId>
  <artifactId>ci-parent</artifactId>
  <name>First CI Friendly</name>
  <version>${revision}${sha1}${changelist}</version>
  ...
  <properties>
    <revision>1.3.1</revision>
    <changelist>-SNAPSHOT</changelist>
    <sha1/>
  </properties>
</project>

If you like to make a version this can simply being achieved by using this:

mvn -Drevision=2.0.0 clean package

Another usage example can be to make a release which can be done via (version 1.3.1):

mvn -Dchangelist= clean package

Or if you like to make a release with another version:

mvn -Drevision=2.7.8 -Dchangelist= clean package

Licenses

Apache Public License 2.0: Plexus Cipher: encryption/decryption Component, Plexus Security Dispatcher Component

Eclipse Public License 1.0: JUnit

Apache 2.0: error-prone annotations

MIT License: SLF4J API Module

BSD-3-Clause: asm, asm-analysis, asm-commons, asm-tree, asm-util

New BSD License: Hamcrest Core

Eclipse Public License, Version 1.0: Aether Utilities

Similar to Apache License but with the acknowledgment clause removed: JDOM

BSD License: XMLUnit for Java

The MIT License: Checker Qual, Mockito

Apache License, Version 2.0: Apache Commons Codec, Apache Commons IO, Apache Commons Lang, Apache Maven Artifact Transfer, Apache Maven Common Artifact Filters, Apache Maven Dependency Tree, Apache Maven Shade Plugin, Apache Maven Shared Utils, Guava: Google Core Libraries for Java, Maven Plugin Tools Java 5 Annotations, Plexus :: Component Annotations, Plexus Common Utilities, jdependency

GNU General Public License, version 2 (GPL2), with the classpath exception: Checker Qual

Apache Maven Resources Plugin

The Resources Plugin handles the copying of project resources to the output directory. There are two different kinds of resources: main resources and test resources. The difference is that the main resources are the resources associated to the main source code while the test resources are associated to the test source code.

Thus, this allows the separation of resources for the main source code and its unit tests.

Starting with version 2.3 this plugin uses the Maven Filtering shared component for filtering resources.

Goals Overview

The Resources Plugin copies files specified by Resource elements, to an output directory. The three variations below only differ in how the resource and output directory elements are specified or defaulted. The Resources Plugin has three goals:

  • resources:resources copies the resources for the main source code to the main output directory.

    This goal usually executes automatically, because it is bound by default to the process-resources life-cycle phase. It always uses the project.build.resources element to specify the resources, and by default uses the project.build.outputDirectory to specify the copy destination.

  • resources:testResources copies the resources for the test source code to the test output directory.

    This goal usually executes automatically, because it is bound by default to the process-test-resources life-cycle phase. It always uses the project.build.testResources element to specify the resources, and by default uses the project.build.testOutputDirectory to specify the copy destination.

  • resources:copy-resources copies resources to an output directory.

    This goal requires that you configure the resources to be copied, and specify the outputDirectory.

Usage

General instructions on how to use the Resources Plugin can be found on the usage page. Some more specific use cases are described in the examples given below.

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.

Examples

The following examples show how to use the Resources Plugin in more advanced use cases:

  • Specifying a character encoding scheme
  • Specifying resource directories
  • Filtering
  • Including and excluding files and directories
  • Escape filtering
  • Copy resources
  • Binaries filtering
  • Custom resources filters
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector