10

Maven 3.xプラグイン内からローカルリポジトリの場所(URI)を取得するには?

4

4 に答える 4

6

このブログ投稿で説明されているように、Aether を使用します。

/**
 * The current repository/network configuration of Maven.
 *
 * @parameter default-value="${repositorySystemSession}"
 * @readonly
 */
private RepositorySystemSession repoSession;

ローカルレポを取得しますRepositorySystemSession.getLocalRepository()

LocalRepository localRepo = repoSession.getLocalRepository();

LocalRepositoryこれはgetBasedir()おそらくあなたが望むものです。

于 2011-09-15T11:01:16.140 に答える