0

Below is my pom.xml. We are still using Java7 and when I run mvn clean install or mvn clean package it creates the Jar just with META-INF and a Manifest file. I do not see the generated classes in the JAR. Please help.

<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>com.myorg</groupId>
<artifactId>myInterface</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Archetype - myClient</name>
<url>http://maven.apache.org</url>
<properties>
 <!-- <cxf.version>2.7.17</cxf.version> -->
 <cxf.version>3.1.11</cxf.version>
 <java.version>1.7</java.version>
 <maven.compiler.source>1.7</maven.compiler.source>
 <maven.compiler.target>1.7</maven.compiler.target>
</properties>
<build>
 <finalName>${project.artifactId}</finalName>
 <plugins>
 <plugin>
 <groupId>org.apache.maven.plugins</groupId> 
 <artifactId>maven-compiler-plugin</artifactId>
 <configuration>
 <verbose>true</verbose>
 <fork>true</fork>
 <compilerVersion>1.7</compilerVersion>
 <source>1.7</source>
 <target>1.7</target>
 </configuration>
 </plugin>
 <plugin>
 <groupId>org.apache.cxf</groupId>
 <artifactId>cxf-codegen-plugin</artifactId>
 <version>${cxf.version}</version>
 <executions>
 <execution>
 <id>generate-sources</id>
 <phase>generate-sources</phase>
 <configuration>
 <sourceRoot>target/main/java</sourceRoot>
 <defaultOptions>
 </defaultOptions>
 <wsdlOptions>
 <wsdlOption>
 <wsdl>data/external/wsdls/resourceMgmt.wsdl</wsdl>
 </wsdlOption>
 <wsdlOption>
 <wsdl>data/external/wsdls/customerMgmt.wsdl</wsdl>
 </wsdlOption>
 <wsdlOption> <wsdl>data/external/wsdls/customerCompositeView.wsdl</wsdl>
 </wsdlOption>
 </wsdlOptions>
 </configuration>
 <goals>
 <goal>wsdl2java</goal>
 </goals>
 </execution>
 </executions>
 </plugin>
 <plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-jar-plugin</artifactId>
 <configuration>
 <!-- DO NOT include log4j.properties file in your Jar -->
 <excludes>
 <exclude>**/log4j.properties</exclude>
 <exclude>**/my.properties</exclude>
 <exclude>**/log4j2.xml</exclude>
 </excludes>
 <archive>
 <manifest>
 <!-- Jar file entry point -->
 <!-- <mainClass>com.mkyong.core.utils.App</mainClass> -->
 </manifest>
 </archive>
 </configuration>
 </plugin>
 <plugin>
 <groupId>org.jvnet.jaxb2.maven2</groupId>
 <artifactId>maven-jaxb2-plugin</artifactId>
 <version>0.13.3</version>
 <executions>
 <execution>
 <id>myabcdvar</id>
 <goals>
 <goal>generate</goal>
 </goals>
 <configuration>
 <generateDirectory>target/main/java</generateDirectory>
 <schemaDirectory>data/external/xsd/Development</schemaDirectory>
 <removeOldOutput>false</removeOldOutput>
 <verbose>true</verbose>
 <excludeTransitive>true</excludeTransitive>
 <extension>true</extension>
 <strict>false</strict>
 <forceRegenerate>true</forceRegenerate>
 <!-- <bindingDirectory>data/external/binding</bindingDirectory> -->
 </configuration>
 </execution>
 </executions>
 </plugin>
 </plugins>
 <pluginManagement>
 <plugins>
 <!--This plugin's configuration is used to store Eclipse m2e settings 
 only. It has no influence on the Maven build itself. -->
 <plugin>
 <groupId>org.eclipse.m2e</groupId>
 <artifactId>lifecycle-mapping</artifactId>
 <version>1.0.0</version>
 <configuration>
 <lifecycleMappingMetadata>
 <pluginExecutions>
 <pluginExecution>
 <pluginExecutionFilter>
 <groupId>
 org.jvnet.jaxb2.maven2
 </groupId>
 <artifactId>
 maven-jaxb2-plugin
 </artifactId>
 <versionRange>
 [0.8.0,)
 </versionRange>
 <goals>
 <goal>generate</goal>
 </goals>
 </pluginExecutionFilter>
 <action>
 <ignore></ignore>
 </action>
 </pluginExecution>
 <pluginExecution>
 <pluginExecutionFilter>
 <groupId>
 org.apache.cxf
 </groupId>
 <artifactId>
 cxf-codegen-plugin
 </artifactId>
 <versionRange>
 [2.2.1,)
 </versionRange>
 <goals>
 <goal>wsdl2java</goal>
 </goals>
 </pluginExecutionFilter>
 <action>
 <ignore></ignore>
 </action>
 </pluginExecution>
 </pluginExecutions>
 </lifecycleMappingMetadata>
 </configuration>
 </plugin>
 </plugins>
 </pluginManagement>
</build>
<dependencies>
 <dependency>
 <groupId>org.apache.logging.log4j</groupId>
 <artifactId>log4j-api</artifactId>
 <version>[2.17.1,)</version>
 </dependency>
 <dependency>
 <groupId>org.apache.logging.log4j</groupId>
 <artifactId>log4j-core</artifactId>
 <version>[2.17.1,)</version>
 </dependency>
 <dependency>
 <groupId>org.apache.logging.log4j</groupId>
 <artifactId>log4j-1.2-api</artifactId>
 <version>[2.17.1,)</version>
 </dependency>
 <dependency>
 <groupId>sample</groupId>
 <artifactId>com.sample</artifactId>
 <version>1.0</version>
 <scope>system</scope>
 <systemPath>${project.basedir}/localLib/esec.jar</systemPath>
 </dependency>
 <dependency>
 <groupId>org.apache.cxf</groupId>
 <artifactId>cxf-rt-frontend-simple</artifactId>
 <version>${cxf.version}</version>
 <exclusions>
 <exclusion>
 <artifactId>jaxb-core</artifactId>
 <groupId>com.sun.xml.bind</groupId>
 </exclusion>
 <exclusion>
 <artifactId>jaxb-impl</artifactId>
 <groupId>com.sun.xml.bind</groupId>
 </exclusion>
 </exclusions>
 </dependency>
 <dependency>
 <groupId>org.apache.cxf</groupId>
 <artifactId>cxf-rt-transports-http</artifactId>
 <version>${cxf.version}</version>
 </dependency>
 <dependency>
 <groupId>org.apache.cxf</groupId>
 <artifactId>cxf-rt-frontend-jaxws</artifactId>
 <version>${cxf.version}</version>
 </dependency>
 <dependency>
 <groupId>commons-lang</groupId>
 <artifactId>commons-lang</artifactId>
 <version>2.6</version>
 </dependency>
 <dependency>
 <groupId>org.apache.axis2</groupId>
 <artifactId>axis2-kernel</artifactId>
 <version>1.7.5</version>
 </dependency>
 <dependency>
 <groupId>org.apache.axis2</groupId>
 <artifactId>axis2-transport-local</artifactId>
 <version>1.7.5</version>
 </dependency>
 <dependency>
 <groupId>org.apache.axis2</groupId>
 <artifactId>axis2-transport-http</artifactId>
 <version>1.7.5</version>
 </dependency>
 <dependency>
 <groupId>junit</groupId>
 <artifactId>junit</artifactId>
 <version>4.13.1</version>
 </dependency>
</dependencies>
asked Jun 1, 2023 at 10:41
3
  • please try: mvn generate-sources Commented Jun 1, 2023 at 10:45
  • @tostao I see an error Failed to collect dependencies at org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:jar:0.13.3 -> org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-core:jar:0.13.3: Failed to read artifact descriptor for org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-core:jar:0.13.3: Could not transfer artifact org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-core:pom:0.13.3 from/to central (repo.maven.apache.org/maven2): Received fatal alert: protocol_version Commented Jun 1, 2023 at 10:54
  • I used mvn -Dhttps.protocols=TLSv1.2 clean install to resolve the issue mentioned in above comment. But still the generated classes are missing from JAR. Commented Jun 1, 2023 at 11:08

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.