Плагин Maven War копирует артефакты, но не добавляет запись - PullRequest
0 голосов
/ 02 августа 2020

У меня есть веб-приложение с указанным ниже содержанием. Используя Maven war plugin 2.2 , я создаю war файл. Но файл war содержит только файл web. xml, ничего больше.

    .
├── META-INF
│   └── webapp-classloading.xml
└── WEB-INF
    ├── beans.xml
    └── web.xml

Пробовал режим Maven DEBUG -X. Могу видеть, что мой военный плагин копирует артефакты, но не добавляет их как записи.

[INFO] --- maven-war-plugin:2.2:war (default-war) @ org.wso2.carbon.identity.organization.mgt.endpoint ---
...
[INFO] Copying webapp resources [/home/data/projects/git/wso2-organization-mgt/org.wso2.carbon.identity.organization.mgt.endpoint/src/main/webapp]
[DEBUG]  + META-INF/webapp-classloading.xml has been copied.
[DEBUG]  + WEB-INF/beans.xml has been copied.
[DEBUG]  + WEB-INF/web.xml has been copied.
[DEBUG] Dump of the current build pathSet content -->
[DEBUG] org.wso2.carbon.identity.organization.management.yaml
[DEBUG] META-INF/webapp-classloading.xml
[DEBUG] WEB-INF/beans.xml
[DEBUG] WEB-INF/web.xml
...
[INFO] Building war: /home/nipun/data/projects/vodafone/git/wso2-organization-mgt/org.wso2.carbon.identity.organization.mgt.endpoint/target/api#identity#organization-mgt#v5.17.5.war
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory WEB-INF/
[DEBUG] adding directory WEB-INF/lib/
[DEBUG] adding entry WEB-INF/lib/spring-expression-5.1.1.RELEASE.jar
[DEBUG] adding entry WEB-INF/web.xml
[DEBUG] adding directory META-INF/maven/
[DEBUG] adding directory META-INF/maven/org.wso2.carbon.identity.framework/
[DEBUG] adding directory META-INF/maven/org.wso2.carbon.identity.framework/org.wso2.carbon.identity.organization.mgt.endpoint/
[DEBUG] adding entry META-INF/maven/org.wso2.carbon.identity.framework/org.wso2.carbon.identity.organization.mgt.endpoint/pom.xml
[DEBUG] adding entry META-INF/maven/org.wso2.carbon.identity.framework/org.wso2.carbon.identity.organization.mgt.endpoint/pom.properties

Как видите, он не добавляет en-запись файла webapp-classloading.xml или beans.xml несмотря на то, что они скопированы.

Самое странное - это другое мое веб-приложение, которое использует ту же зависимость, и версии плагинов (тот же родительский) правильно копируют эти артефакты в файл войны. Там я мог видеть добавленные записи.

[INFO] --- maven-war-plugin:2.2:war (default-war) @ org.wso2.carbon.identity.configuration.mgt.endpoint ---
...
[INFO] Copying webapp resources [/home/data/repos/wso2/carbon-identity-framework/components/configuration-mgt/org.wso2.carbon.identity.configuration.mgt.endpoint/src/main/webapp]
[DEBUG]  + META-INF/webapp-classloading.xml has been copied.
[DEBUG]  + WEB-INF/beans.xml has been copied.
[DEBUG]  + WEB-INF/web.xml has been copied.
[DEBUG] Dump of the current build pathSet content -->
[DEBUG] org.wso2.carbon.identity.configuration.management.yaml
[DEBUG] META-INF/webapp-classloading.xml
[DEBUG] WEB-INF/beans.xml
[DEBUG] WEB-INF/web.xml
...
[INFO] Building war: /home/nipun/data/repos/wso2-support/carbon-identity-framework/components/configuration-mgt/org.wso2.carbon.identity.configuration.mgt.endpoint/target/api#identity#config-mgt#v1.0.war
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory WEB-INF/
[DEBUG] adding directory WEB-INF/lib/
[DEBUG] adding directory WEB-INF/classes/
[DEBUG] adding directory WEB-INF/classes/META-INF/
[DEBUG] adding directory WEB-INF/classes/org/
[DEBUG] adding directory WEB-INF/classes/org/wso2/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/configuration/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/configuration/mgt/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/configuration/mgt/endpoint/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/configuration/mgt/endpoint/factories/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/configuration/mgt/endpoint/exception/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/configuration/mgt/endpoint/util/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/configuration/mgt/endpoint/impl/
[DEBUG] adding directory WEB-INF/classes/org/wso2/carbon/identity/configuration/mgt/endpoint/dto/
[DEBUG] adding entry META-INF/webapp-classloading.xml
[DEBUG] adding entry WEB-INF/beans.xml
[DEBUG] adding entry WEB-INF/lib/reflections-0.9.11.jar
[DEBUG] adding entry WEB-INF/lib/swagger-annotations-1.5.20.jar
[DEBUG] adding entry WEB-INF/lib/commons-lang3-3.2.1.jar
[DEBUG] adding entry WEB-INF/lib/olingo-odata2-core-incubating-1.1.0.jar
[DEBUG] adding entry WEB-INF/lib/javassist-3.21.0-GA.jar
[DEBUG] adding entry WEB-INF/lib/validation-api-1.1.0.Final.jar
[DEBUG] adding entry WEB-INF/lib/commons-codec-1.6.jar
[DEBUG] adding entry WEB-INF/lib/swagger-core-1.5.20.jar
[DEBUG] adding entry WEB-INF/lib/swagger-jaxrs-1.5.20.jar
[DEBUG] adding entry WEB-INF/lib/olingo-odata2-api-incubating-1.1.0.jar
[DEBUG] adding entry WEB-INF/lib/swagger-models-1.5.20.jar
[DEBUG] adding entry WEB-INF/web.xml
[DEBUG] adding entry WEB-INF/classes/META-INF/NOTICE
[DEBUG] adding entry WEB-INF/classes/META-INF/DEPENDENCIES
[DEBUG] adding entry WEB-INF/classes/META-INF/LICENSE
[DEBUG] adding entry WEB-INF/classes/org.wso2.carbon.identity.configuration.management.yaml
[DEBUG] adding entry WEB-INF/classes/org/wso2/carbon/identity/configuration/mgt/endpoint/factories/ResourceTypeApiServiceFactory.class

POM-файлы проектов и их родителей совпадают.

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <webResources>
                        <resource>
                            <!-- this is relative to the pom.xml directory -->
                            <directory>src/main/resources/</directory>
                        </resource>
                    </webResources>
                    <warName>api#identity#organization-mgt#v${project.version}</warName>
                    <packagingExcludes>WEB-INF/lib/commons-logging*.jar</packagingExcludes>
                    <packagingExcludes>WEB-INF/lib/axis2*.jar</packagingExcludes>
                    <packagingExcludes>WEB-INF/lib/axiom*.jar</packagingExcludes>
<!--                    <packagingIncludes>WEB-INF/lib/spring-*.jar, WEB-INF/lib/cxf-core*.jar</packagingIncludes>-->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/gen/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Plugin for generating the swagger server stubs-->
<!--            <plugin>-->
<!--                <groupId>org.wso2.maven.plugins</groupId>-->
<!--                <artifactId>swagger2cxf-maven-plugin</artifactId>-->
<!--                <version>1.0-SNAPSHOT</version>-->
<!--                <configuration>-->
<!--                    <inputSpec>-->
<!--                        ${project.basedir}/src/main/resources/org.wso2.carbon.identity.organization.management.yaml-->
<!--                    </inputSpec>-->
<!--                </configuration>-->
<!--            </plugin>-->
        </plugins>

Благодарю за любую помощь по этому поводу.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...