maven

docker with maven jar

流过昼夜 提交于 2021-01-29 11:46:52
问题 I'm running a maven project in a docker container, I'm getting Could not find or load main class error. FROM maven:3.6.0-jdk-11-slim AS build COPY src src COPY pom.xml . RUN mvn -f pom.xml clean package install FROM openjdk:8-jre COPY --from=build /target /opt/target WORKDIR /target RUN ls CMD ["java", "-jar", "Customer.jar"] above assembly was created with following plugin in <build> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>com

Spring STS not loading environment variables but running maven works

天涯浪子 提交于 2021-01-29 11:38:47
问题 I'm using Mac OS Mojave with Spring STS version 3.9.7. So I'm trying to load some environment variables such as database username & password into my application.properties file but Spring fails to load them into. I'v used this command to set the username environment variable: export ABC_DB_UNAME=some_username and when I do echo $ABC_DB_UNAME or printenv I can see the value. In my application.properties file I set the username as below: spring.datasource.username=${ABC_DB_UNAME} Now when

Why can't I compile maven with OpenJFX and Deeplearning4J?

二次信任 提交于 2021-01-29 11:22:33
问题 I have a small issue that I don't know how to solve. I have started a simple basic JavaFX application and my pom.xml file looks like this: <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>se.danielmartensson</groupId> <artifactId>JNonlinearControl</artifactId> <version>0.0.1-SNAPSHOT</version>

Getting `NoClassDefFoundError` for classes `FutureCallback` and `LazyList` using Jetty Maven plugin 9.4.32.v20200930 on Java 11

余生颓废 提交于 2021-01-29 11:18:41
问题 I started a few months ago to maintain an old Spring project using the Jetty Maven plugin. I'm currently trying to port it to Java 11 but Jetty won't start the server and (silently) fails with MultiException[java.lang.NoClassDefFoundError: org/eclipse/jetty/util/FutureCallback, java.lang.NoClassDefFoundError: org/eclipse/jetty/util/LazyList] . This seems to be an old bug of the Jetty Maven plugin that I can reproduce on various 9.x versions. It seems fixed in versions 10 and 11 and I would

mvn test doesn't fail when Cucumber scenario fails

混江龙づ霸主 提交于 2021-01-29 11:13:25
问题 I have a RunCucumberTest class as described in the JUnit section here and a Cucumber scenario that fails when run from the gutter icon in IntelliJ. However, why does mvn test build successfully? [WARNING] Tests run: 482, Failures: 0, Errors: 0, Skipped: 12 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:10 min [INFO] Finished at:

NoSuchMethodError: optionsBuilder.build().getService() in Google Cloud Storage

夙愿已清 提交于 2021-01-29 11:01:13
问题 I am trying to connect to google bucket to upload a file. StorageOptions.Builder optionsBuilder = StorageOptions.newBuilder(); optionsBuilder.setCredentials(GoogleCredentials.getApplicationDefault()); Storage storage = optionsBuilder.build().getService(); I have provided service account in environment variables and when i looked into optionsBuilder.build() the credentials are added correctly including projectId, credentials etc. but service property is showing null. its giving error for

Code Coverage for Cucumber Tests using Jacoco

妖精的绣舞 提交于 2021-01-29 10:52:17
问题 I am trying to integrate Jacoco to get the code coverage for my Cucumber tests using Maven. Following is my project structure: -src-main-java-Pages -src-main-java-Helper -src-test-java-resources-features -src-test-java-Steps Following is the Jacoco configuration in my POM.xml <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.8.2</version> <configuration> <destFile>${basedir}/target/coverage-reports/jacoco.exec</destFile> <dataFile>${basedir}/target

java.lang.ClassNotFoundException: javax.ws.rs.ProcessingException

泄露秘密 提交于 2021-01-29 10:35:53
问题 I'm writing an Apache Camel Spring Boot application to consume and produce to an AMQP/JMS broker. I can successfully run the application via IntelliJ, but when I try to run the application via command line, I get the ProcessingException. When I include javax.ws.rs-api version 2.0.1 in my pom file, I then get java.lang.ClassNotFoundException: javax.ws.rs.client.ClientException I've tried several different versions of javax.ws.rs-api and Apache CXF without success. I cant figure out the

Maven - How to replace value in any file in other location?

断了今生、忘了曾经 提交于 2021-01-29 10:12:58
问题 I have to replace value in file: test.xml This file location is: src/main/app . It is possible ? 回答1: Properties could be changed based on the ${app.name}. There is no need to change flow to change property file. <configuration-properties doc:name="Configuration properties" file="/var/mule/${MULE_ENV}/${app.name}/global.yaml" /> https://simpleflatservice.com/mule4/Properties.html 来源: https://stackoverflow.com/questions/61912352/maven-how-to-replace-value-in-any-file-in-other-location

Spring Cloud Config Server - empty array for refreshed keys

半腔热情 提交于 2021-01-29 09:21:32
问题 I have a spring cloud config server as in this repo And a client in this repo following is my POM file <?xml version="1.0" encoding="UTF-8"?> <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>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2