5

I am using linux(mint mate), and installed maven by download & unzip & config the environment, I could use the mvn command.

I want to have man mvn, not just mvn -help, any tip?


@Update:

To make the question clear, there is no man page for mvn, because I install maven by unzip, so I want to install man page for mvn, so that I could use man mvn to get help.

Eric
  • 22,183
  • 20
  • 145
  • 196

3 Answers3

4

The only way to get the man page for maven is to install maven from apt-get install maven2, but the man page is exactly the same as mvn -help, so I don't see any use in using the version from the repositories because most of the time is an old version.

http://www.manpagez.com/man/1/mvn/

Ricardo
  • 3,696
  • 5
  • 36
  • 50
isma3l
  • 3,833
  • 1
  • 22
  • 28
  • Disappointingly, this answer appears to be correct. In an ideal world, Maven would have comprehensive man-pages, like Git. I.e. `man mvn` would provide the Maven man page as it currently does, but `man mvn X` would provide a man page for plugin X. E.g. `man mvn dependency` would provide a man-page describing the goals and options for the [Maven dependency plugin](https://maven.apache.org/plugins/maven-dependency-plugin/). –  May 25 '17 at 18:03
  • Hm, it looks like at least some Maven plugins do provide help at the CLI, though, albeit not via man-pages. E.g. `mvn compiler:help -Ddetail=true`. –  May 26 '17 at 12:43
2

There is no man page for Maven. It doesn't exist. There's nothing available to install.

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152
1

If your download did not include man pages for mvn and mvnDebug, you can use help2man to easily generate mvn.1.gz and then symlink mvnDebug.1.gz to it.

# Change INSTALL_HOME to point to your Maven install path.
INSTALL_HOME="/opt/maven/apache-maven-3.8.4"

mkdir "${INSTALL_HOME}/man"
help2man -o "${INSTALL_HOME}/man/mvn.1" "${INSTALL_HOME}/bin/mvn"
gzip "${INSTALL_HOME}/man/mvn.1"
ln -s "${INSTALL_HOME}/man/mvn.1.gz" "${INSTALL_HOME}/man/mvnDebug.1.gz"

To bind man page(s) and mvnDebug command into the same alternative as mvn, just add slave options then configure the new alternative:

sudo update-alternatives --install "/usr/bin/mvn" "mvn" "${INSTALL_HOME}/bin/mvn" 500 \
  --slave "/usr/bin/mvnDebug" "mvnDebug" "${INSTALL_HOME}/bin/mvnDebug" \
  --slave "/usr/share/man/man1/mvn.1.gz" "mvn.1.gz" "${INSTALL_HOME}/man/mvn.1.gz" \
  --slave "/usr/share/man/man1/mvnDebug.1.gz" "mvnDebug.1.gz" "${INSTALL_HOME}/man/mvnDebug.1.gz"

sudo update-alternatives --config mvn
Rick O'Sullivan
  • 351
  • 3
  • 7