I'm configuring my maven project on DevOps, but I receive an assembling WAR error.
I've uploaded my project on the DevOps Repository and created a pipeline. My pipeline is composed by the following job:
Here is my eq/pom.xml 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>XXXX</groupId>
<artifactId>cq</artifactId>
<version>4.0</version>
</parent>
<groupId>it.XXXX</groupId>
<artifactId>cq-be-internal-services-war</artifactId>
<packaging>war</packaging>
<name>cq-be-internal-services-war</name>
<description>Web Services Batch Module</description>
<properties>
<jaxws.version>2.1.3</jaxws.version>
</properties>
<dependencies>
<dependency>
<groupId>com.ibm.websphere.appserver</groupId>
<artifactId>was_public</artifactId>
<version>8.5.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>it.XXX</groupId>
<artifactId>cq-be-internal-services-business</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<finalName>CQImport</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<warName>cqm-be-services</warName>
<source>1.7</source>
<target>1.7</target>
<failOnMissingWebXml>false</failOnMissingWebXml>
<webResources>
<resource>
<directory>${project.build.sourceDirectory}</directory>
<targetPath>WEB-INF\classes\</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
And here is the error
2020-10-21T19:21:29.9662437Z [INFO] Reactor Summary for cq root 4.0:
2020-10-21T19:21:29.9662755Z [INFO]
2020-10-21T19:21:29.9664783Z [INFO] CQ root ........................................... SUCCESS [ 1.766 s]
2020-10-21T19:21:29.9679554Z [INFO] cq-be-internal-services-business .................. SUCCESS [ 4.994 s]
2020-10-21T19:21:29.9682033Z [INFO] cq-be-internal-services-war ....................... FAILURE [ 2.156 s]
2020-10-21T19:21:29.9682663Z [INFO] cq-be-services-ear ................................ SKIPPED
2020-10-21T19:21:29.9692819Z [INFO] BUILD FAILURE
2020-10-21T19:21:29.9697818Z [INFO] ------------------------------------------------------------------------
2020-10-21T19:21:29.9698294Z [INFO] Total time: 27.116 s
2020-10-21T19:21:29.9699005Z [INFO] Finished at: 2020-10-21T19:21:29Z
2020-10-21T19:21:29.9699671Z [INFO] ------------------------------------------------------------------------
2020-10-21T19:21:29.9771508Z [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war (default-war) on project cq-be-internal-services-war: Error assembling WAR: /home/vsts/work/1/s/eq/cq-be-internal-services-war/target/CQImport/WEB-INF/classes/it/XXXX/cq/ws/StorCServiceImpl.java -> [Help 1]
2020-10-21T19:21:29.9779002Z org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war (default-war) on project cq-be-internal-services-war: Error assembling WAR: /home/vsts/work/1/s/eq/cq-be-internal-services-war/target/CQImport/WEB-INF/classes/it/XXXX/cq/ws/StorCServiceImpl.java
2020-10-21T19:21:29.9782836Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
2020-10-21T19:21:29.9785031Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2020-10-21T19:21:29.9785666Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2020-10-21T19:21:29.9788094Z at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2020-10-21T19:21:29.9790406Z at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2020-10-21T19:21:29.9793248Z at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2020-10-21T19:21:29.9796342Z at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2020-10-21T19:21:29.9797083Z at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2020-10-21T19:21:29.9799040Z at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2020-10-21T19:21:29.9801111Z at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2020-10-21T19:21:29.9801637Z at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2020-10-21T19:21:29.9803826Z at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2020-10-21T19:21:29.9804325Z at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2020-10-21T19:21:29.9806290Z at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2020-10-21T19:21:29.9806802Z at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)
2020-10-21T19:21:29.9808767Z at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2020-10-21T19:21:29.9809491Z at java.lang.reflect.Method.invoke (Method.java:607)
2020-10-21T19:21:29.9813743Z at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2020-10-21T19:21:29.9817220Z at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2020-10-21T19:21:29.9817876Z at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2020-10-21T19:21:29.9820814Z at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2020-10-21T19:21:29.9823721Z Caused by: org.apache.maven.plugin.MojoExecutionException: Error assembling WAR: /home/vsts/work/1/s/eq/cq-be-internal-services-war/target/CQImport/WEB-INF/classes/it/XXXX/cq/ws/StorCServiceImpl.java
2020-10-21T19:21:29.9826073Z at org.apache.maven.plugin.war.WarMojo.execute (WarMojo.java:191)
2020-10-21T19:21:29.9828017Z at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
2020-10-21T19:21:29.9828653Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
2020-10-21T19:21:29.9830680Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2020-10-21T19:21:29.9832604Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2020-10-21T19:21:29.9834580Z at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2020-10-21T19:21:29.9836633Z at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2020-10-21T19:21:29.9838785Z at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2020-10-21T19:21:29.9839468Z at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2020-10-21T19:21:29.9842258Z at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2020-10-21T19:21:29.9842760Z at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2020-10-21T19:21:29.9847705Z at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2020-10-21T19:21:29.9848003Z at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2020-10-21T19:21:29.9848275Z at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2020-10-21T19:21:29.9852637Z at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2020-10-21T19:21:29.9852929Z at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2020-10-21T19:21:29.9853223Z at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)
2020-10-21T19:21:29.9857093Z at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2020-10-21T19:21:29.9857426Z at java.lang.reflect.Method.invoke (Method.java:607)
2020-10-21T19:21:29.9861871Z at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2020-10-21T19:21:29.9862264Z at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2020-10-21T19:21:29.9862640Z at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2020-10-21T19:21:29.9869585Z at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2020-10-21T19:21:29.9871441Z Caused by: org.codehaus.plexus.archiver.ArchiverException: /home/vsts/work/1/s/eq/cq-be-internal-services-war/target/CQImport/WEB-INF/classes/it/XXXX/cq/ws/StorCServiceImpl.java
2020-10-21T19:21:29.9877442Z at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext (AbstractArchiver.java:497)
2020-10-21T19:21:29.9878235Z at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain (AbstractZipArchiver.java:233)
2020-10-21T19:21:29.9883131Z at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute (AbstractZipArchiver.java:211)
2020-10-21T19:21:29.9883577Z at org.codehaus.plexus.archiver.AbstractArchiver.createArchive (AbstractArchiver.java:944)
2020-10-21T19:21:29.9884135Z at org.apache.maven.archiver.MavenArchiver.createArchive (MavenArchiver.java:598)
2020-10-21T19:21:29.9888892Z at org.apache.maven.plugin.war.WarMojo.performPackaging (WarMojo.java:244)
2020-10-21T19:21:29.9889647Z at org.apache.maven.plugin.war.WarMojo.execute (WarMojo.java:175)
2020-10-21T19:21:29.9890223Z at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
2020-10-21T19:21:29.9900525Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
2020-10-21T19:21:29.9901423Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2020-10-21T19:21:29.9901787Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2020-10-21T19:21:29.9905448Z at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2020-10-21T19:21:29.9905917Z at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2020-10-21T19:21:29.9906389Z at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2020-10-21T19:21:29.9912639Z at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2020-10-21T19:21:29.9913575Z at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2020-10-21T19:21:29.9914083Z at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2020-10-21T19:21:29.9919441Z at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2020-10-21T19:21:29.9925021Z at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2020-10-21T19:21:29.9925448Z at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2020-10-21T19:21:29.9932561Z at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2020-10-21T19:21:29.9932888Z at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2020-10-21T19:21:29.9933263Z at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)
2020-10-21T19:21:29.9939770Z at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2020-10-21T19:21:29.9940328Z at java.lang.reflect.Method.invoke (Method.java:607)
2020-10-21T19:21:29.9940670Z at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2020-10-21T19:21:29.9946696Z at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2020-10-21T19:21:29.9947547Z at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2020-10-21T19:21:29.9947990Z at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2020-10-21T19:21:29.9954875Z Caused by: java.nio.file.NoSuchFileException: /home/vsts/work/1/s/eq/cq-be-internal-services-war/target/CQImport/WEB-INF/classes/it/XXXX/cq/ws/StorCServiceImpl.java
2020-10-21T19:21:29.9955448Z at sun.nio.fs.UnixException.translateToIOException (UnixException.java:86)
2020-10-21T19:21:29.9959953Z at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:102)
2020-10-21T19:21:29.9960340Z at sun.nio.fs.UnixException.rethrowAsIOException (UnixException.java:107)
2020-10-21T19:21:29.9961065Z at sun.nio.fs.UnixFileAttributeViews$Posix.readAttributes (UnixFileAttributeViews.java:210)
2020-10-21T19:21:29.9967194Z at sun.nio.fs.UnixFileAttributeViews$Posix.readAttributes (UnixFileAttributeViews.java:123)
2020-10-21T19:21:29.9967739Z at sun.nio.fs.UnixFileSystemProvider.readAttributes (UnixFileSystemProvider.java:144)
2020-10-21T19:21:29.9968210Z at sun.nio.fs.LinuxFileSystemProvider.readAttributes (LinuxFileSystemProvider.java:97)
2020-10-21T19:21:29.9974220Z at java.nio.file.Files.readAttributes (Files.java:1686)
2020-10-21T19:21:29.9974654Z at org.codehaus.plexus.components.io.attributes.Java7AttributeUtils.getFileAttributes (Java7AttributeUtils.java:124)
2020-10-21T19:21:29.9975118Z at org.codehaus.plexus.components.io.attributes.Java7FileAttributes.<init> (Java7FileAttributes.java:62)
2020-10-21T19:21:29.9979544Z at org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection.addResourcesJava7 (PlexusIoFileResourceCollection.java:188)
2020-10-21T19:21:29.9980267Z at org.codehaus.plexus.components.io.resources.PlexusIoFileResourceCollection.getResources (PlexusIoFileResourceCollection.java:236)
2020-10-21T19:21:29.9984970Z at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext (AbstractArchiver.java:493)
2020-10-21T19:21:29.9985428Z at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.createArchiveMain (AbstractZipArchiver.java:233)
2020-10-21T19:21:29.9985854Z at org.codehaus.plexus.archiver.zip.AbstractZipArchiver.execute (AbstractZipArchiver.java:211)
2020-10-21T19:21:29.9990046Z at org.codehaus.plexus.archiver.AbstractArchiver.createArchive (AbstractArchiver.java:944)
2020-10-21T19:21:29.9990462Z at org.apache.maven.archiver.MavenArchiver.createArchive (MavenArchiver.java:598)
2020-10-21T19:21:29.9990830Z at org.apache.maven.plugin.war.WarMojo.performPackaging (WarMojo.java:244)
2020-10-21T19:21:29.9994593Z at org.apache.maven.plugin.war.WarMojo.execute (WarMojo.java:175)
2020-10-21T19:21:29.9994989Z at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
2020-10-21T19:21:29.9998529Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
2020-10-21T19:21:29.9998951Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
2020-10-21T19:21:29.9999322Z at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
2020-10-21T19:21:30.0003166Z at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
2020-10-21T19:21:30.0003655Z at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
2020-10-21T19:21:30.0007609Z at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
2020-10-21T19:21:30.0008113Z at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
2020-10-21T19:21:30.0012565Z at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
2020-10-21T19:21:30.0013088Z at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
2020-10-21T19:21:30.0017645Z at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
2020-10-21T19:21:30.0018189Z at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
2020-10-21T19:21:30.0018878Z at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
2020-10-21T19:21:30.0022611Z at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
2020-10-21T19:21:30.0022914Z at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
2020-10-21T19:21:30.0023258Z at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:57)
2020-10-21T19:21:30.0026795Z at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
2020-10-21T19:21:30.0027149Z at java.lang.reflect.Method.invoke (Method.java:607)
2020-10-21T19:21:30.0030670Z at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
2020-10-21T19:21:30.0031197Z at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
2020-10-21T19:21:30.0031564Z at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
2020-10-21T19:21:30.0035015Z at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
2020-10-21T19:21:30.0035262Z [ERROR]
2020-10-21T19:21:30.0035392Z [ERROR]
2020-10-21T19:21:30.0035658Z [ERROR] For more information about the errors and possible solutions, please read the following articles:
2020-10-21T19:21:30.0039778Z [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
2020-10-21T19:21:30.0040037Z [ERROR]
2020-10-21T19:21:30.0040233Z [ERROR] After correcting the problems, you can resume the build with the command
2020-10-21T19:21:30.0040783Z [ERROR] mvn <args> -rf :cq-be-internal-services-war
2020-10-21T19:21:30.0163780Z The process '/usr/share/apache-maven-3.6.3/bin/mvn' failed with exit code 1
2020-10-21T19:21:30.0166531Z Could not retrieve code analysis results - Maven run failed.
2020-10-21T19:21:30.9966657Z Result Attachments will be stored in LogStore
2020-10-21T19:21:31.0097059Z Run Attachments will be stored in LogStore
2020-10-21T19:21:31.0432050Z No Result Found to Publish '/home/vsts/work/1/s/eq/cq-be-internal-services-business/target/surefire-reports/TEST-it.xxx.cq.ws.jaxrs.TestGNService.xml'.
2020-10-21T19:21:31.0438408Z No Result Found to Publish '/home/vsts/work/1/s/eq/cq-be-internal-services-war/target/surefire-reports/TEST-it.xxx.cq.TestImportMassivo.xml'.
2020-10-21T19:21:31.0553009Z ##[error]Build failed.
2020-10-21T19:21:31.0603213Z ##[section]Async Command Start: Publish test results
2020-10-21T19:21:31.1493783Z ##[section]Async Command End: Publish test results
2020-10-21T19:21:31.1495079Z ##[section]Finishing: Maven eq/pom.xml
I've already tried different configuration. Here some of them:
source
and the target
tag in the pom file and setting the JDK version in DevOps with JDK 7
value<failOnMissingWebXml>false</failOnMissingWebXml>
line in the pom fileI'm stuck with this error and I don't have any other idea.
I solved the problem!
I have changed the tag <targetPath>WEB-INF/classes/</targetPath>
to <targetPath>WEB-INF\classes\</targetPath>
.