плагин блока знатока - как создать вложенные блоки

Мы используем Word. Это помещается в наше управление версиями, таким образом, у нас есть история (существует папка документации, связанная с каждым проектом). Форматированием можно управлять с помощью шаблонов, все из которых мы теперь настроили, так внесение изменений легко сделать в рамках стандартов расположения. Файлы могут быть экспортированы в PDF. Можно опубликовать их как документы только для чтения для совместного использования с пользователями.

29
задан Robert 3 July 2015 в 11:28
поделиться

2 ответа

With your existing configuration, your two separate configurations for the assembly plugin will be merged, and the configurations will also be merged.

To achieve your goal you should define a single assembly-plugin configuration with multiple nested executions, then define the configuration for each execution inside it. The assembly plugin will then execute each assembly sequentially, so the jar-with-dependencies jar will be available for inclusion in the dist jar. Also note the attached goal is deprecated in favour of the single goal.

Also note that paths in the assembly are relative to the root, and to include a particular file you should use the element rather than the element. You can also specify properties in the assembly to make it less fragile to change.

The rearranged configuration and assembly below should do what you're after:

Assembly descriptor:

<assembly>
  <id>dist</id>
  <formats>
    <format>tar.gz</format>
    <format>tar.bz2</format>
    <format>zip</format>
  </formats>
  <files>
    <file>
      <source>
        target/${project.artifactId}-${project.version}-jar-with-dependencies.jar
      </source>
      <outputDirectory>/</outputDirectory>
    </file>
  </files>
  <fileSets>
    <fileSet>
      <directory>${project.basedir}/src/main/resources</directory>
      <includes>
        <include>*</include>
      </includes>
     <outputDirectory>/</outputDirectory> 
    </fileSet>
  </fileSets>
</assembly>

Assembly plugin:

<plugin>
 <artifactId>maven-assembly-plugin</artifactId>
 <executions>
  <execution>
   <id>jar-with-dependencies</id>
   <phase>package</phase>
   <goals>
    <goal>single</goal>
   </goals>
   <configuration>
    <descriptorRefs>
     <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
    <archive>
     <manifest>
      <mainClass>quicksearch.QuickSearchApp</mainClass>
     </manifest>
    </archive>
   </configuration>
  </execution>
  <execution>
   <id>dist</id>
   <phase>package</phase>
   <goals>
    <goal>single</goal>
   </goals>
   <configuration>
    <descriptors>
     <descriptor>src/main/assembly/dist.xml</descriptor>
    </descriptors>
   </configuration>
  </execution>
 </executions>
</plugin>
47
ответ дан 28 November 2019 в 01:40
поделиться

У вас есть две разные конфигурации для подключаемого модуля сборки, и вы хотите, чтобы они запускались по порядку (jar перед zip), но я не думаю, что Maven подразумевает какой-либо порядок в том, как это будет решен. Я предполагаю, что zip-файл создается перед файлом JAR.

Даже если это не так, я бы посоветовал вам создать один модуль для каждого артефакта. Переместите сборку JAR в отдельный модуль и сделайте так, чтобы от него зависел теперь только модуль Zip. Таким образом, разрешение порядка зависимостей Maven может сработать и выстроить их по порядку.

0
ответ дан 28 November 2019 в 01:40
поделиться
Другие вопросы по тегам:

Похожие вопросы: