maven

include application-properties from multiple modules in maven multi-module spring-boot executable jar

帅比萌擦擦* 提交于 2021-01-28 10:58:32
问题 we have a maven multi-module pom project with a core-module where i want to keep common application.properties, like database-access, email-gateways etc. Is it possible to integrate those application*.properties in the executable jar of the other modules as well (jars built by spring-boot-maven-plugin )? when taking a look into the built jar, you can see that only the module's resources are integrated, all other modules are ignored. Thanks 来源: https://stackoverflow.com/questions/49856000

maven compile sometimes fail and sometimes succeed

痴心易碎 提交于 2021-01-28 09:01:47
问题 I use vs code and have already installed "Lombok Annotations Support for VS Code". I use maven clear and then compile, and I got Compilation failure. Then when I try maven compile several seconds later, it build success. I do nothing between two maven compilation. I check the error message, it seems that Lombok annotations don't work. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) [ERROR] symbol: method setName(java.lang.String) [ERROR]

Maven - Add a maven module as dependency to other maven module

佐手、 提交于 2021-01-28 09:00:26
问题 I have 2 Spring boot maven projects(module A, Module B). And they both are added as modules to a parent project. Both Modules have some common dependencies and java classes(Domain objects), so I created third module Module C, and placed all the common java files and dependencies there. I added the Module C to parent pom as one of the module. And added Module C as dependency to Module A and Module B. In Module A, B wherever the classes of Module C is referred there it was resolved and is

How does mvn dependency:analyze work?

只谈情不闲聊 提交于 2021-01-28 08:19:45
问题 Can someone let me know how does mvn dependency:analyze work ? An output of mvn dependency:analyze in one of my project shows [WARNING] Used undeclared dependencies found: [WARNING] org.apache.commons:commons-lang3:jar:3.4:compile [WARNING] com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile ... [WARNING] Unused declared dependencies found: [WARNING] org.springframework.boot:spring-boot-starter-test:jar:1.5.4.RELEASE:test [WARNING] org.springframework.restdocs:spring-restdocs

How can i add images in source folder of a Maven Java Project?

為{幸葍}努か 提交于 2021-01-28 07:34:32
问题 I have images in source folder of a maven java project. you can see it in the below image. if i run install command of maven, when i see generated jar file , i could not see the images in sources in the jar file. My maven configuration is like below. <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.1</version> <configuration> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4<

maven dependency conflict only in eclipse

三世轮回 提交于 2021-01-28 07:09:35
问题 We have several applications as a number of modules; we've been using NetBeans. I am attempting to move the development to eclipse. All projects are built with Maven. One of them uses dbunit, and also POI. When I try to compile it in eclipse, it gives me an error for a bad method signature. Neither NetBeans build with maven nor command-line build give me this error. I discovered that the compiler was attempting to compile using a version of POI older than the one we use. The specific version

Maven hangs when taking input from Scanner

吃可爱长大的小学妹 提交于 2021-01-28 07:08:26
问题 I am designing a program that has to run with the mvn test command and take a user input from the command line. When I run the program with mvn test everything works until Scanner.next() is executed, then the CLI hangs and I have to close the program. my test method public class AppTest { @Test public void shouldAnswerWithTrue() { Scanner sc = new Scanner(System.in); System.out.println("Awaiting input"); String in = sc.next(); System.out.println("TEST!" + in); assertTrue( true ); } } my pom

Error: Could not find or load main class … - Maven project out of Eclipse

随声附和 提交于 2021-01-28 06:11:30
问题 I created a Maven project with Eclipse and I am able to run the App.java in Eclipse. But now I want to run it out of Eclipse with this command: ..\workspace\subscribe\target\classes> java com.mqtt.subscribe.App EDIT: with executable jar : ..\workspace\subscribe>java -jar target\subscribe-0.0.1-SNAPSHOT.jar and get this error: Error: Could not find or load main class com.mqtt.subscribe.App What I am doing wrong? I don't understand it. I also try to rebuild the project with mvn package and mvn

Build Failure GeoNetwork opensource

混江龙づ霸主 提交于 2021-01-28 05:20:58
问题 I try build GeoNetwork opensource, but I have the following problem when I run "mvn clean install -DskipTests": Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0 Apache Maven 3.5.2 Maven home: /usr/share/maven Java version: 1.8.0_191, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: it_IT, platform encoding: UTF-8 OS name: "linux", version: "4.15.0-20-generic", arch: "amd64", family: "unix" [INFO]

Java project with Maven dependency compiles but fails at runtime

妖精的绣舞 提交于 2021-01-28 05:13:18
问题 EDIT: This question should absolutely not be closed. I'm NOT asking how to create an executable jar. A jar doesn't need to be executable to be run from the terminal. For example, if I have have this code: package com.dogzilla.maven.quickstart; public class App { public static void main( String[] args ) { System.out.println( "Hello World" ); } } ...and Maven builds it, it creates quickstart-0.0.1-SNAPSHOT.jar. Which is not, ahem, 'executable'. I can run it from the terminal quite successfully