ABOUT
Maven Reloaded is an IntelliJ IDEA plugin that provides Maven 2 build system functionality.
FEATURES
The Maven Reloaded plugin works in the following ways:
- When
a project is opened, it searches every module's content roots for Maven 2 POM files
(pom.xml). If those files are found, it processes them all. POM files
are re-processed when changes to the file are made. However, if a user
creates a new pom.xml file, it will be disabled until enabled manually
(allowing the user time to fill in the file before it is parsed). In addition, the plugin is disabled by default for new projects for the same reason. Please note that there is a crude filtering option for excluding certain directories from the POM search.
- Each POM file found is parsed and interrogated for required and transitive dependencies. This process will do two things. First, it will update the module's classpath and insert any jar dependencies derived from the POM (direct and transitive). Second, if another module has a POM that represents a dependency of a POM being processed, that module will be loaded as a module dependency. For example, if I have two modules, A and B, with POM files that are processed, and the POM file in module B has a dependency that matches the group ID, artifact ID, and version of the POM file in module A, then module A will be loaded as a dependency of module B. In addition, the artifact represented by the POM of module A will not be added as a jar dependency to module B, since the source is kept locally in module A and linked in through the IDE.
- The plugin can manage the source roots of your project modules by interrogating the POMs in the project. It can also use the POMs to generate sources and include the source roots in your module configuration.
- Dependency sources and javadoc can be optionally downloaded and attached to compiled jar depenencies in the classpath.
- Users can execute Maven goals on a specific POM through the Maven context menu.
- The plugin can sort the derived dependencies so that entries stored in the .ipr and .iml files are consistently ordered between runs.
- The plugin can optionally attempt to remove duplicate dependencies in the module's classpath (i.e. multiple versions of the same dependency that were included from different POMs).
USAGE
The plugin integrates tightly into the IntelliJ IDE, so there is no centralized place to manage your Maven POMs. There is a Maven subsection of the main Build menu that allows you to reprocess all POMs in the project. In addition, any POM file (pom.xml) has a Maven context menu added (when right clicked) that allows a user to reprocess the POM (Update Project), execute a goal (Execute Goals), and toggle the POM's state (Enable/Disable).
- When the processing is finished, you will notice that the plugin has modified your classpath, adding entries that start with 'Maven Dependency' and possibly attaching sources and javadoc. In addition, any inter-module dependencies have been resolved.
-
In addition, the source roots of each module will be updated to reflect
the current source and test folders of the project that your POMs
represent. Note that, if the plugin is configured to generate sources, sources generated by maven will be in this listing automatically.
-
Users that wish to disable a POM from being processed can use the Maven
context menu on the pom.xml file and select the 'Disable' option. This
will remove the POM from consideration and reprocess the project.
Previously added classpath entries and inter-module dependencies will
be removed.
-
All actions that occur in the plugin (and the Maven embedder that does
the processing) are logged to a special Maven logging console.
-
When Maven is executing it takes focus from the IDE, and runs in a progress panel.
-
When a user elects to execute a POM, an input dialog is presented that
prompts the user to enter the Maven command. This can be a series of
goals separated by spaces that you wish to be run on the POM. In
addition, properties can be passed by using the
-Dsyntax, for example-Dmaven.test.failure.ignoreor-Dhttps.proxyHost=myproxy.
-
The plugin reacts to changes in the project. For example, adding or
removing a module will trigger the POMs to be re-processed. In
addition, adding a new file called pom.xml to a module will prompt the
plugin to register the new file as a POM, but it will not re-process
the POMs. All new POM files are added as 'disabled' until the user
enables it manually. This is so that a person can create a file and
work on the POM until it is ready without the plugin trying to
(unsuccessfully) parse it.
-
Finally, the plugin can be configured through a graphical dialog in the
IntelliJ settings GUI. The configuration is stored in the project, so
settings are preserved between runs of IntelliJ.
CAVEATS
The plugin is relatively young, so there are some problems and unimplemented features.
- The
dependency resolution may turn up multiple versions of the same dependency (i.e. log4j-1.2.12 and log4j-1.2.13) and add them all to the
classpath. The plugin can optionally attempt to resolve this conflict by picking the most recent dependency and removing all others.
- The plugin runs on a custom version of the Maven embedder (2.1-SNAPSHOT), and should obey your settings.xml file. Any proxies specified in the file will be obeyed, although Maven has its own issues with https repositories...
- Cancelling the Maven update action may cause unexpected results. If in doubt, manually remove all inter-module dependencies and re-run Maven on the entire project from the Build menu.
BEST PRACTICES
The plugin will work best if users create projects with multiple modules, each containing one POM. However, multiple POMs per module are supported.
CONTACT
- End users of the plugin can send questions and comments to the user list, mavenreloaded-user@googlegroups.com. Be sure to check out the archives.
- Developers can correspond on the developer list, mavenreloaded-dev@googlegroups.com, which is archived here.
- Bug reports can be posted to the bug tracking system on the project home page.
LICENSE
The plugin is released under the MIT License. The source is free to distribute and modify if the terms of the license are followed. The software is restricted to personal use and is not authorized for profitable commercial use.







