Создание толстого фляги с несколькими доступными плагинами, плагин для сборки maven для проекта на основе Spring - PullRequest
0 голосов
/ 22 февраля 2019

Я пытаюсь создать толстую банку, простую весеннюю базовую программу.Сборка работает, но есть два файла META-INF, которые в процессе затираются.Я пытался использовать сборку, потому что плагин "shade" недоступен для нашего репозитория.

Я бы подумал, что это сработает, но не получится, как ожидалось, файлы схемы будут засорены.

Maven file:

    <!-- Create fatjar jar for executing -->            
        <!-- http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies -->
        <plugin>
            <!-- See: https://maven.apache.org/plugins/maven-assembly-plugin/usage.html -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.1.0</version>
            <configuration>
                <!-- 
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                 -->
                <descriptors>
                    <descriptor>exec-jar.xml</descriptor>
                </descriptors>
                <archive>
                    <manifest>
                      <mainClass>com.primerica.clientcomm.dcebatch.app.DCELeanplumBatchApplication</mainClass>
                    </manifest>                     
                </archive>
            </configuration>
            <executions>
                <execution>
                    <id>assemble-all</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>    

Exec Jar:

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
    <id>jar-with-dependencies</id>
    <formats>
        <format>jar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>        
            <unpack>true</unpack>
            <unpackOptions>
                <excludes>
                    <exclude>META-INF/spring.handlers</exclude>
                    <exclude>META-INF/spring.schemas</exclude>
                </excludes>
            </unpackOptions>
            <scope>runtime</scope>
        </dependencySet>
    </dependencySets>
    <files>
        <file>
            <source>${project.basedir}/src/main/resources/META-INF/spring.handlers</source>
            <outputDirectory>META-INF</outputDirectory>
        </file>
        <file>
            <source>${project.basedir}/src/main/resources/META-INF/spring.schemas</source>
            <outputDirectory>META-INF</outputDirectory>
        </file>
        <file>
            <source>${project.basedir}/src/main/resources/META-INF/spring-dcebatch.schemas</source>
            <outputDirectory>META-INF</outputDirectory>
        </file>
    </files>
</assembly>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...