Category : maven

I use dependency:go-offline to avoid redownloading in my Docker build. Yet the docker build -t myimage . causes the jars to be redownloaded. How can I prevent redownloading? Relevant part of the Dockerfile. FROM maven:3.8.3-jdk-8 AS build COPY src /usr/src/app/src COPY pom.xml /usr/src/app COPY run.sh /usr/src/app RUN mvn -f /usr/src/app/pom.xml dependency:go-offline RUN mvn -f /usr/src/app/pom.xml ..

Read more

I am developing small Spring Boot micro-service application. I am facing an issue when I am trying to create custom Spring image to deploy into Docker engine. To create new custom image I am using configuration element in Maven plugin section of my POM file. Error : Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.5:build-image (default-cli) on project ..

Read more

To be honest, some time ago I have found the answer to this problem and solved it. The problem is that I forgot it. I remember I had to generate a single executable jar in the out/artifacts/.. my build from pom.xml : <build> <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0</version> <executions> <execution> <id>tomcat-run</id> <goals> <goal>exec-war-only</goal> </goals> <phase>package</phase> ..

Read more

I have an application based on java spring in kubernetes. For multipule environments I use spring profiles. But I need to rebuild my app for each environment using maven+docker to get the right config and push it into kubernetes. Here are my lines in pipeline: – mvn clean -Dspring.profiles.active=$ENV_PROFILE package – DOCKER_BUILDKIT=1 docker build –build-arg ..

Read more

Although there are a few similar questions, I could not find the answer to this question. I have the following structure – Child – src – pom.xml – Parent – pom.xml – Dockerfile Child pom.xml <parent> <groupId>someID</groupId> <artifactId>parent</artifactId> <version>1.0.0-SNAPSHOT</version> <relativePath>../parent/pom.xml</relativePath> </parent> My Docker file FROM maven:3.6.3-jdk-11 as build WORKDIR /apps COPY ./parent . RUN mvn ..

Read more

I’ve a maven multimodule project Project |— executable | |— src | |— pom.xml |— core | |— src | |— pom.xml |— pom.xml The root pom.xml looks like this <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.5</version> <relativePath/> </parent> <groupId>com.playgrounds</groupId> <artifactId>playgrounds-api</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <properties> <java.version>11</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.google.firebase</groupId> ..

Read more