私はJavaでプラグイン設定を読み込む必要があります。私はaetherライブラリを使用して実行時の依存関係を取得し、時間依存関係などをコンパイルしましたが、petherファイルに基づいてプラグインの設定を読み込むためにaetherを使用できますか?aetherを使用してPOMからプラグイン設定を取得できますか?
私はこのメカニズム
から
some-Prop 8080
some-prop-admin 8081
を解決できるようにしたい、この
<properties>
<servicePort>8080</servicePort>
<adminPort>8081</adminPort>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.company.group</groupId>
<artifactId>my-plugin</artifactId>
<version>0.1-SNAPSHOT</version>
<configuration>
<myConfig>
<somePropName>someProp</somePropName>
<portMappings>
<someProp>${servicePort}</someProp>
<someProp-admin>${adminPort}</someProp-admin>
</portMappings>
</myConfig>
</configuration>
</plugin>
</plugins>
</build>
ような何か現在、私はこの
Dependency dependency = new Dependency(new DefaultArtifact(
coordinate), COMPILE);
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(dependency);
collectRequest.addRepository(this.aetherSession
.getRemoteRepository());
DependencyNode node = this.aetherSession
.getRepoSystem()
.collectDependencies(this.aetherSession.getRepoSession(),
collectRequest).getRoot();
DependencyRequest dependencyRequest = new DependencyRequest();
dependencyRequest.setRoot(node);
result = this.aetherSession
.getRepoSystem()
.resolveDependencies(this.aetherSession.getRepoSession(),
dependencyRequest).getArtifactResults();
FinalResult.addAll(result);
コンパイル時の依存関係を取得するために現在のコードを投稿できますか? Mavenプラグインまたは外部アプリケーションを作成していますか? – Tunaki
これはJavaアプリケーションで、petherからaetherを使用してプラグインの設定を読みたい –