The following is the pom file.
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jaxb.pojo</groupId>
<artifactId>xml</artifactId>
<version>1.0.0.0001</version>
<name>XML JAXB jar</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaDirectory>src/main/resources/xsd</schemaDirectory>
<schemaIncludes>
<include>*.xsd</include>
</schemaIncludes>
<generateDirectory>src/main/java</generateDirectory>
<generatePackage>com.jaxb.pojo</generatePackage>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
When I run the maven command, the xml-1.0.0.0001.jar is created but the jar has XSD files as well along with the generated class files. The below is the generated jar structure.
|_xsd
|_META-INF
|_com
Need help in excluding the XSD while generating the jar.
question from:
https://stackoverflow.com/questions/65894005/unable-to-exclude-xsd-files-when-using-maven-to-create-a-jar-of-jaxb-objects 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…