Mavenベースのプロジェクト用にjavadoc jarを生成する
“http://maven.apache.org/plugins/maven-javadoc-plugin/[maven-javadoc]”プラグインは、 “JDK \ bin \ javadoc.exe”コマンドを使用して
javadocs
を生成し、jarファイルにパックしますプロジェクトとともに展開してください。
1. Maven JavaDoc Plugin
“pom.xml”ファイルに “maven-javadoc`”プラグインを追加してください。
File:pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4__0__0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.mkyong</groupId> <artifactId>mkyongcore</artifactId> <packaging>jar</packaging> <version>1.0</version> <name>mkyongcore project</name> <url>http://maven.apache.org</url> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
2.それを展開する
Issue “` mvn install` “を実行すると、javadocが生成されパッケージ化され、プロジェクトがローカルリポジトリに展開されます。
D:\mkyongweb-core>mvn install[INFO]Scanning for projects...[INFO]------------------------------------------------------------------------[INFO]Building mkyongcore project[INFO] task-segment:[install][INFO]------------------------------------------------------------------------//... Loading source files for package com.mkyong.core... Constructing Javadoc information... Standard Doclet version 1.6.0__13 Building tree for all the packages and classes... Generating D:/mkyongweb-core/target/apidocs\com/mkyong/core/\App.html... Generating D:/mkyongweb-core/target/apidocs\com/mkyong/core/\package-frame.html... Generating D:/mkyongweb-core/target/apidocs\com/mkyong/core/\package-summary.html... Generating D:/mkyongweb-core/target/apidocs\com/mkyong/core/\package-tree.html... Generating D:/mkyongweb-core/target/apidocs\constant-values.html... Generating D:/mkyongweb-core/target/apidocs\com/mkyong/core/\class-use\App.html... Generating D:/mkyongweb-core/target/apidocs\com/mkyong/core/\package-use.html... Building index for all the packages and classes... Generating D:/mkyongweb-core/target/apidocs\overview-tree.html... Generating D:/mkyongweb-core/target/apidocs\index-all.html... Generating D:/mkyongweb-core/target/apidocs\deprecated-list.html... Building index for all classes... Generating D:/mkyongweb-core/target/apidocs\allclasses-frame.html... Generating D:/mkyongweb-core/target/apidocs\allclasses-noframe.html... Generating D:/mkyongweb-core/target/apidocs\index.html... Generating D:/mkyongweb-core/target/apidocs\help-doc.html... Generating D:/mkyongweb-core/target/apidocs\stylesheet.css...[INFO]Building jar: D:\mkyongweb-core\target\mkyongcore-1.0-javadoc.jar[INFO][install:install {execution: default-install}][INFO]Installing D:\mkyongweb-core\target\mkyongcore-1.0.jar to D:\maven\repo\com\mky ong\mkyongcore\1.0\mkyongcore-1.0.jar[INFO]Installing D:\mkyongweb-core\target\mkyongcore-1.0-javadoc.jar to D:\maven\repo \com\mkyong\mkyongcore\1.0\mkyongcore-1.0-javadoc.jar[INFO]------------------------------------------------------------------------[INFO]BUILD SUCCESSFUL