0

Я работаю с библиотекой picocli и хочу создать сценарий авто завершения команд во время сборки. Дело в том, что в документации (https://picocli.info/autocomplete.html#_generating_completion_scripts_during_the_build) указан только пример плагина в Maven:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>${exec-maven-plugin.version}</version>
  <executions>
    <execution>
      <id>generate-autocompletion-script</id>
      <phase>package</phase>
      <goals>
        <goal>exec</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <executable>java</executable>
    <arguments>
      <argument>-Dpicocli.autocomplete.systemExitOnError</argument>
      <argument>-cp</argument>
      <classpath/>
      <argument>picocli.AutoComplete</argument>
      <argument>--force</argument>
      <argument>--completionScript</argument>
      <argument>${project.build.directory}/mycommand_completion.sh</argument>
      <argument>mypackage.MyCommand</argument>
    </arguments>
  </configuration>
</plugin>

Однако я использую Gradle и мне нужно как то адаптировать этот плагин под сборку в нём (на Котлин). Я пробовал создавать проект с pom.xml и затем вызывать gradle init, но он переводит только зависимости и не учитывает плагины.

1 ответ 1

0

Судя по документации Gradle, плагины неконвертируемы.
Необходимо искать замену, либо писать свой.

Replace Maven plugins with Gradle equivalents

In the case of popular plugins, Gradle often has an equivalent plugin that you can use. You might also find that you can replace a plugin with built-in Gradle functionality. As a last resort, you may need to reimplement a Maven plugin via your own custom plugins and task types.

https://docs.gradle.org/current/userguide/migrating_from_maven.html

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.