У меня есть проект, использующий плагин maven jetty, и он загружает дубликаты (идентичные) jar на пути к классам. Один раз из WEB-INF / lib и снова из пути к классу maven. Как я могу исключить maven classpath из сборки и просто использовать созданный WEB-INF / lib? Это все из-за создания файла войны?
Я получаю много МБ предупреждений, подобных этому, из множества разных файлов jar.
[WARNING] net.bytebuddy.pool.TypePool$Default$LazyTypeDescription$GenericTypeToken scanned from multiple locations: [jar:file:///Users/josephwhite/.m2/repository/net/bytebuddy/byte-buddy/1.9.10/byte-buddy-1.9.10.jar!/net/bytebuddy/pool/TypePool$Default$LazyTypeDescription$GenericTypeToken.class, jar:file:///projects/entando/entando-sample-app/target/entando-sample-app/WEB-INF/lib/byte-buddy-1.9.10.jar!/net/bytebuddy/pool/TypePool$Default$LazyTypeDescription$GenericTypeToken.class]
Соответствующие части pom. xml файл
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.entando.entando</groupId>
<artifactId>entando-sample-app</artifactId>
<packaging>war</packaging>
<version>6.0.0-SNAPSHOT</version>
<name>entando-sample-app</name>
<url>http://www.entando.com/</url>
<licenses>
<license>
<name>GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1, February 1999</name>
<url>https://www.gnu.org/licenses/lgpl-2.1.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<name>Entando Inc.</name>
<url>http://www.entando.com/</url>
</organization>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<properties>
<!--
<test.database.driver>org.postgresql.Driver</test.database.driver>
<test.database.hostname>localhost</test.database.hostname>
<test.database.port>5432</test.database.port>
<test.database.username>agile</test.database.username>
<test.database.password>agile</test.database.password>
<test.database.port.url>jdbc:postgresql://${test.database.hostname}:${test.database.port}/${project.artifactId}testPort</test.database.port.url>
<test.database.serv.url>jdbc:postgresql://${test.database.hostname}:${test.database.port}/${project.artifactId}testServ</test.database.serv.url>
-->
<!--
<test.database.driver>com.mysql.jdbc.Driver</test.database.driver>
<test.database.hostname>localhost</test.database.hostname>
<test.database.port>3306</test.database.port>
<test.database.username>root</test.database.username>
<test.database.password>agile</test.database.password>
<test.database.port.url>jdbc:mysql://${test.database.hostname}:${test.database.port}/${project.artifactId}testPort</test.database.port.url>
<test.database.serv.url>jdbc:mysql://${test.database.hostname}:${test.database.port}/${project.artifactId}testServ</test.database.serv.url>
-->
<test.database.driver>org.apache.derby.jdbc.EmbeddedDriver</test.database.driver>
<test.database.hostname>localhost</test.database.hostname>
<test.database.port>1527</test.database.port>
<test.database.username>agile</test.database.username>
<test.database.password>agile</test.database.password>
<test.database.port.url>
jdbc:derby:${project.build.directory}/test/db/${project.artifactId}testPort;create=true
</test.database.port.url>
<test.database.serv.url>
jdbc:derby:${project.build.directory}/test/db/${project.artifactId}testServ;create=true
</test.database.serv.url>
<docker.host.address>172.17.0.1</docker.host.address>
<env.db.environment>production</env.db.environment>
<entando.engine.web.context>${project.build.finalName}</entando.engine.web.context>
<skipDocker>true</skipDocker>
<server.init.command>echo noop</server.init.command>
<skipSmokeTests>true</skipSmokeTests>
<autoCreateNetwork>true</autoCreateNetwork>
<entando.version>6.0.0-SNAPSHOT</entando.version>
<entando.keycloak.plugin.version>6.0.0-SNAPSHOT</entando.keycloak.plugin.version>
<spring.version>5.1.8.RELEASE</spring.version>
<struts2.version>2.5.17</struts2.version>
<postgres.driver.version>9.4.1212</postgres.driver.version>
<postgres.driver.version>9.4.1212</postgres.driver.version>
<jetty.version>9.4.8.v20180619</jetty.version>
<keycloak.enabled>false</keycloak.enabled>
<keycloak.auth.url>http://localhost:8081/auth</keycloak.auth.url>
<keycloak.realm>entando</keycloak.realm>
<keycloak.client.id>entando-app</keycloak.client.id>
<keycloak.client.secret>b4b34472-9926-4753-9db8-a50f152df3da</keycloak.client.secret>
<keycloak.public.client.id>entando-web</keycloak.public.client.id>
<log4j-dev.location>${project.basedir}/src/main/resources/log4j.properties</log4j-dev.location>
</properties>
....
</dependencies>
<profiles>
<profile>
<id>jetty-local</id>
<properties>
<!--Image configuration -->
<skipDocker>false</skipDocker>
<skipAppBuilderImage>false</skipAppBuilderImage>
<jee.server>jetty</jee.server>
<entando.engine.address>localhost</entando.engine.address>
<app.builder.depends.on></app.builder.depends.on>
<skipServerImage>true</skipServerImage>
<jboss.home.in.image>none</jboss.home.in.image>
<server.base.image>none</server.base.image>
<derby.base.folder>${project.build.directory}/derby/${env.db.environment}</derby.base.folder>
<!--Hard coded ports for local development -->
<appbuilder.port>5000</appbuilder.port>
<entando.engine.port>8080</entando.engine.port>
<db.server.local.port>${db.server.port}</db.server.local.port>
<log.level>ERROR</log.level>
</properties>
</profile>
<profile>
<id>local-ports</id>
<properties>
<!--Hard coded ports for local development -->
<appbuilder.port>5000</appbuilder.port>
<db.server.local.port>${db.server.port}</db.server.local.port>
<entando.engine.port>8080</entando.engine.port>
</properties>
</profile>
<profile>
<id>eap</id>
<properties>
<!--Image configuration -->
<skipDocker>false</skipDocker>
<skipAppBuilderImage>false</skipAppBuilderImage>
<jee.server>eap</jee.server>
<entando.engine.address>${docker.host.address}</entando.engine.address>
<app.builder.depends.on>${project.artifactId}-engine</app.builder.depends.on>
<skipServerImage>false</skipServerImage>
<jboss.home.in.image>/opt/eap</jboss.home.in.image>
<server.base.image>entando-eap71-clustered-base</server.base.image>
<derby.base.folder>/entando-data/databases</derby.base.folder>
</properties>
</profile>
<profile>
<id>wildfly</id>
<properties>
<!--Image configuration -->
<skipDocker>false</skipDocker>
<skipAppBuilderImage>false</skipAppBuilderImage>
<jee.server>wildfly</jee.server>
<entando.engine.address>${docker.host.address}</entando.engine.address>
<app.builder.depends.on>${project.artifactId}-engine</app.builder.depends.on>
<skipServerImage>false</skipServerImage>
<jboss.home.in.image>/wildfly</jboss.home.in.image>
<server.base.image>entando-wildfly12-base</server.base.image>
<derby.base.folder>/entando-data/databases</derby.base.folder>
</properties>
</profile>
<profile>
<id>jetty-container</id>
<properties>
<!--Image configuration -->
<skipDocker>false</skipDocker>
<jee.server>jetty</jee.server>
<skipAppBuilderImage>false</skipAppBuilderImage>
<entando.engine.address>${docker.host.address}</entando.engine.address>
<app.builder.depends.on>${project.artifactId}-engine</app.builder.depends.on>
<skipServerImage>false</skipServerImage>
<jboss.home.in.image>/wildfly</jboss.home.in.image>
<server.base.image>entando-jetty948-base</server.base.image>
<derby.base.folder>/entando-data/databases</derby.base.folder>
</properties>
</profile>
</profiles>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/conf</directory>
<filtering>true</filtering>
<targetPath>WEB-INF/conf</targetPath>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.xsd</include>
</includes>
</resource>
<resource>
<directory>src/main/tld</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>**/*.tld</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/config/conf</directory>
<targetPath>${project.build.directory}/test/conf</targetPath>
<filtering>true</filtering>
</testResource>
<testResource>
<directory>src/test/resources</directory>
<targetPath>${project.build.directory}/test-classes</targetPath>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<!-- This is explicitly declared in project deps.-->
<dependentWarExcludes>WEB-INF/lib/byte-buddy-*.jar</dependentWarExcludes>
<webResources>
<resource>
<directory>src/main/tld</directory>
<targetPath>WEB-INF/tld</targetPath>
<includes>
<include>**/*.tld</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/conf</directory>
<targetPath>WEB-INF/conf</targetPath>
<includes>
<include>**/*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
<filters>
<filter>${*}</filter>
</filters>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<followSymlinks>true</followSymlinks><!-- performance -->
<filesets>
<fileset>
<directory>${project.build.directory}</directory>
<excludes>
<exclude>**/derby/production/**</exclude>
</excludes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
<reportSets>
<reportSet>
<reports>
<report>summary</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>