有没有人知道在POM中声明依赖项的文件句柄的最佳方法?我意识到有一个依赖插件,但我们试图避免将工件复制到本地目录的成本(文件很大)。
答案 0 :(得分:0)
所以伪代码如下所示:
Artifact artifact = ArtifactFactory.createArtifact("group", "artifact", "version1");
// The local Repo and remote repo can be injected into your mojo using annoations.
AtifactResolver resolver = new AtifactResolver(localRepo, remoteRepoList);
resolver.resolve(artificat);
File file = artifact.getFile();