Jtest のビルド システム プラグインを使用すると、自動的に検出されたコンパイル データを手動で拡張またはオーバーライドできます。Jtest プラグインの構成パラメーターは、互いに関連しています。
コンパイル データ モデルには <compilation> および <compilations> パラメーターに渡されるデータの構造が含まれます。
<!-- configuration section of Jtest build system plugin -->
<!-- single compilation data customization -->
<compilation>
<!--
Compilation id. If not defined default id for used build system will be used.
-->
<id>non_default_id</id>
<!-- List of source directories -->
<sourcepath>
<path>src/main/java</path>
<path>${path_1}</path>
</sourcepath>
<!-- List of directories with compiled classes -->
<binarypath>
<path>${basedir}/target/classes</path>
</binarypath>
<!-- List of classpath jars -->
<classpath>
<path>${extra-classpath-element}</path>
</classpath>
<!-- List of Java jars -->
<bootpath>
<path>${JAVA_HOME}/jre/lib/rt.jar</path>
</bootpath
<encoding>UTF-8</encoding>
<sourcelevel>1.5</sourcelevel>
<!--
When set to "true" fully overrides detected compilation
data with same id on same project. When set to "false"
only extends it. By default "false".
-->
<override>false</override>
</compilation>
<!--
Multiple compilation data customizations can be used
if project performs multiple compilations.
-->
<compilations>
<compilation>
<id>different_id</id>
<!-- ... compilation data -->
</compilation>
<compilation>
<id>another_id</id>
<!-- ... compilation data -->
</compilation>
</compilations>
<!-- ... -->
すべてのプロジェクトのコンパイル データを変更する必要がある場合、XML ファイルを変更するのではなく、コマンド ラインで -Djtest.dataUpdate オプションを使用できます。このオプションを使用すると、JSON のプロジェクト コンパイル データを手動で変更できます。
以下を更新できます。
- classpath
- bootpath
- sourcepath
- resourcepath
- binarypath
- encoding
- sourcelevel
サポートされているアクション:
- prepend - リストの先頭にエントリを追加します (複数のパスはカンマで区切る)
- append - リストの末尾にエントリを追加します (複数のパスはカンマで区切る)
- set - 現在のデータを上書きします
例:
-Djtest.dataUpdate=compilations.classpath.append="/tmp/last1.jar","/tmp/last2.jar"(リストの末尾にパスを追加)-Djtest.dataUpdate=compilations.encoding.set="UTF-8"(新しいエンコーディングを指定)-Djtest.dataUpdate=compilations.bootpath.prepend="/tmp/first.jar";compilations.sourcelevel.set="1.8"(リストの先頭にパスを追加し、新しい sourcelevel を指定)