1

We currently use a Jenkins pipeline for an Angular 7 and Spring Boot project, in which, among other things, the maven-dependency-plugin is in use.

Unfortunately, we have the problem that the "coverage" folder, which is generated automatically after the unit tests pass successfully (by using jasmine/karma), does not always end up in the final .jar file.

I have to repeat the process again and again, so that the folder eventually ends up in the .jar file. Really happens only now and then, if I'm lucky ^^. The folder is definitely always generated and ends up in both the "dist" and the "target" folder. It is really missing only in the .jar file or better said is not always stored in it.

Is this problem known or is there a better solution that I can put into my pom.xml?

Here is the current state of my pom.xml. I also post the part with the maven-resources-plugin, if that should help.

 ...
 <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>3.1.1</version>
    <executions>
      <execution>
        <id>copy-dependencies-to-target</id>
        <phase>prepare-package</phase>
        <goals>
          <goal>copy-dependencies</goal>
        </goals>
        <configuration>
          <classifier>dist</classifier>
          <outputDirectory>target</outputDirectory>
          <overWriteReleases>true</overWriteReleases>
          <overWriteSnapshots>true</overWriteSnapshots>
          <overWriteIfNewer>true</overWriteIfNewer>
          <excludeTransitive>false</excludeTransitive>
          <stripVersion>true</stripVersion>
          <includeScope>runtime</includeScope>
          <includeGroupIds>${project.groupId}</includeGroupIds>
        </configuration>
      </execution>
    </executions>
  </plugin>
  <plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.1.0</version>
    <executions>
      <execution>
        <id>copy-resources</id>
        <phase>process-resources</phase>
        <goals>
          <goal>copy-resources</goal>
        </goals>
        <configuration>
          <outputDirectory>${basedir}/target/classes</outputDirectory>
          <resources>
            <resource>
              <directory>dist</directory>
              <filtering>true</filtering>
              <includes>
                <include>**</include>
              </includes>
            </resource>
          </resources>
        </configuration>
      </execution>
    </executions>
  </plugin>
  <plugin>
    <artifactId>maven-release-plugin</artifactId>
    <version>2.5.3</version>
    <configuration>
      <localCheckout>true</localCheckout>
      <tagNameFormat>@{project.version}</tagNameFormat>
    </configuration>
  </plugin>
</plugins>

The remaining plugins, which are in use, I always use in the latest and most stable version.

I hope someone can help me, so that the builds in the Jekins pipeline are stable and I can rely on it.

Codehan25
  • 2,704
  • 10
  • 47
  • 94

0 Answers0