📜 ⬆️ ⬇️

Maven Overview Plugin

I can not share the joy associated with the "pressure" of the author of this wonderful plugin ...
... although everything is in order.

Maven on Habré was already presented in brief here as a great tool for building Java projects and controlling dependencies between modules. Of the main advantages over the closest analogues (for example, ANT , make , < i hrf = ant ant.apache.org/ivy > Ivy) I would single out the following:
- Competently organized management of life cycles of the module (Life cycle) such as compile, test, package, install, deploy
- Object model of the project (POM), which allows to use all the advantages of OOP in the development of project modules (for example, inheritance, reuse)
- Plug-in architecture that allows you to easily expand Maven add. capabilities (for example, to generate documentation or source code, a connector with VershKontrol or deployer to a new version of the J2EE-Application server, etc.)
- Introduced the concept of Maven repository, as a repository of finished modules (artifacts). The repository serves mainly for two purposes - storing your own compiled artifacts and access to third-party artifacts, kindly provided by the OpenSource community. To use any artifact it is enough to specify the artefactId and repository correctly, in case the artifact is in a non-standard place. The rest of the maven does himself - the search and download of the artifact occurs automatically. Also provides a mechanism for automatically updating artifacts in the case of updating them in the developer's repository. Thus, Maven can always “keep” both himself and his controlled projects up to date without additional efforts on the part of the developer.
- Integration with most popular IDEs, such as Eclipse, NetBeans, IDEA, JDeveloper.


So first, the essence of the task: to build a “foreseeable” picture of an already existing maven project.
At the current stage, a sufficient number of projects have accumulated, sometimes not tightly connected with each other. And the question of how they actually work and interact is getting more and more relevant. In addition, projects use a variety of, sometimes completely incompatible "third-party" frameworks, in which in order to simply "cover" the entire depth of cross-dependencies, you need to kill a month, if not more than one.
')
Front of work: for now, we limit ourselves to the only project that customers often see. He is very, at first glance, not obvious in his "dependencies", in which our beloved Maven 2 is so cool.
Objective: to make the secret explicit (well, or in a dry language to build a dependency diagram, so cool is presented on the site of the plugin itself).

Dry-Zwei-Ains-DAINZ (for the uninitiated - quote from an advertisement in Ebay in Germany 3-2-1 - and YOU! :))
So the initial conditions
- the project already exists. pom.xml as it should be where it should be in the root. compilation, warmup, and even partially JUnit tests work. Hindus successfully deployed and developed IT for more than a year.
- settings.xml (understanding the recommendations of the author correctly change by adding a piece from the last post ...
<pluginRepositories>
...
<pluginRepository>
<id> overview-snapshot-repo </ id>
<url> http://maven-overview-plugin.googlecode.com/svn/snapshot-repository/ </ url>
<snapshots>
<enabled> true </ enabled>
</ snapshots>
</ pluginRepository>
...
</ pluginRepositories>


... voila, everything should now work.

So - go to the root of the project and do 1-2-3:

1. #mvn -version
Maven version: 2.0.8
Java version: 1.5.0_14
OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows"

2. #mvn -e com.agilejava.maven.plugins: maven-overview-plugin: overview
+ Error stacktraces are turned on.
[INFO] Scanning for projects ...
WAGON_VERSION: 1.0-beta-2
[INFO] - [INFO] Building
...

[INFO] [overview: overview]
[INFO] MavenOverviewMojo: Created outputFile: target \ site \ images \ overview.png
[INFO] MavenOverviewMojo: Incrementing graph
[INFO] MavenOverviewMojo: Graph at: target \ site \ images \ overview.png
[INFO] - [INFO] BUILD SUCCESSFUL
[INFO] - [INFO] Total time: 3 seconds
[INFO] Finished at: Sun Jun 22 00:04:07 CEST 2008
[INFO] Final Memory: 7M / 17M
[INFO] -


3. Run-jumps into the desired target \ site \ images \ overview.png
and (lo and behold!) the desired picture came to life!
Yahoooooooooooo!

The only thing left now is to understand how IT works;)

Source: https://habr.com/ru/post/27765/


All Articles