question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explode WAR instead of working on exploded WAR directory for Maven

See original GitHub issue

Explode the WAR file rather than using this directory. The contents of the final WAR may be different from this directory (it’s possible to include or exclude files when packaging a WAR. Also the exploded WAR directory is configurable with <webappDirectory> and may not be at build.getFinalName().

https://github.com/GoogleContainerTools/jib/pull/1068/files#r221696396

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
TadCordlecommented, Oct 18, 2019
1reaction
edrandallcommented, Oct 16, 2019

The following maven ‘hack’ seems to provide a crude workaround, by extracting the META-INF/ from the war into the working dir after packaging but before the Jib goal executes:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <version>3.1.1</version
  <executions>
    <execution>
      <id>unpack-meta-inf</id>
      <phase>package</phase>
      <goals>
        <goal>unpack</goal>
      </goals>
      <configuration>
        <artifactItems>
          <artifactItem>
            <groupId>${project.groupId}</groupId>
            <artifactId>${project.artifactId}</artifactId>
            <version>${project.version}</version>
            <type>war</type>
            <overWrite>true</overWrite>
            <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
            <includes>META-INF/</includes>
          </artifactItem>
        </artifactItems>
      </configuration>
    </execution>
  </executions>
</plugin>
Read more comments on GitHub >

github_iconTop Results From Across the Web

war:exploded - Apache Maven WAR Plugin
Directory to unpack dependent WARs into if needed. Default value is: ${project.build.directory}/war/work . Optional Parameters ...
Read more >
How to get Maven to run war:exploded but not war:war
The solution is quite simple. You need to override the default execution of the war plugin to disable it and add your own...
Read more >
Classes/resources are not copied to WEB-INF war exploded ...
I'm a beginner in maven project and web application. I didn't know how put my .class files into my war exploded. It was:...
Read more >
Beware of mvn war:inplace - Command Line Fanatic
I looked at the target directory. It was new. Brand new. I checked the new .war, exploding and decompiling the contents again. It...
Read more >
Using exploded deployments and CLI attachments - WildFly
Deploy an artifact and explode it. Creating an exploded deployment from scratch. Let's create a from_scratch.war deployment: [standalone@ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found