maven-module

Travis CI fails with Child module … does not exist

江枫思渺然 提交于 2019-12-24 11:23:20
问题 My git repository structure is as following: -my-repo -.mvn -.travis.yml -my-parent-project -child-module -pom.xml -pom.xml Where the parent pom includes <modules> <module>child-module</module> </modules> And my .travis.yml looks like: sudo: true language: java jdk: oraclejdk9 os: linux before_install: - chmod +x ./my-project-parent/* - cd my-project-parent install: true script: ./mvnw clean install cache: directories: - $HOME/.m2 When Travis CI build runs I'm getting: [ERROR] The project io

maven - advice on usage of multi-modules (jar, war, …) project

别说谁变了你拦得住时间么 提交于 2019-12-23 04:46:14
问题 I have the following Maven organization: - ./pom.xml (top-level project, which defines the 4 modules below) - ./a/pom.xml (jar) - ./b/pom.xml (jar) - ./c/pom.xml (war) - ./d/pom.xml (war) So far, I have been using Maven as following (all executed in the root): 1. mvn clean compile install 2. mvn tomcat7:redeploy -pl c 3. mvn tomcat7:redeploy -pl d Although this works perfectly, I am not really sure if this is the preferred way. In the first step, I am installing all projects, but actually,

One profile properties are overriding with another profile properties in maven?

淺唱寂寞╮ 提交于 2019-12-13 00:45:58
问题 I have a problem with maven profiles. Coming to the details, I have two profiles like profile1 and profile2. I have declared few properties for both the profiles along with the modules which needs to be updated by each profile individually. Let see the below configuration, <profiles> <profile> <id>profile1</id> <properties> <owner>ABC</owner> </properties> <modules> <module>module1</module> <module>module2</module> </modules> <profile> <profile> <id>profile2</id> <properties> <owner>XYZ<

Hibernate and JPA error: duplicate import on dependent Maven project

折月煮酒 提交于 2019-12-12 15:52:18
问题 I have two Maven projects, one called project-data and the other one call project-rest which has a dependency on the project-data project. The Maven build is successful in the project-data project but it fails in the project-rest project, with the exception: Caused by: org.hibernate.DuplicateMappingException: duplicate import: TemplatePageTag refers to both com.thalasoft.learnintouch.data.jpa.domain.TemplatePageTag and com.thalasoft.learnintouch.data.dao.domain.TemplatePageTag (try using auto

Maven inherit parent module resources

六眼飞鱼酱① 提交于 2019-12-11 00:08:42
问题 In Maven, is it possible to load resources in a child module from the parent project? parent project ---child module 1 ---child module 2 I have resources in the parent project src/main/resources which I would like to be made available for the child projects. Ideally the child projects could override any of the resources. 回答1: Best way to leverage resources from a library and / or override resources that are in the library is to put those resources in the class path. For e.g. say all common

How to test Maven module project with Spring Boot

╄→гoц情女王★ 提交于 2019-12-07 03:32:13
问题 I have split a project, based on Spring Boot, into several Maven modules. Now only the war-project contains a starter class (having a main method, starting Spring), the other modules are of type jar. How do I test the jar projects, if they don't include a starter? Example JUnit test case header: @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(StarterClassInDifferentProject.class) ... 回答1: I think context tests should be available per module so you can find issues with

Spring boot with maven multi module project

江枫思渺然 提交于 2019-12-06 01:34:01
问题 I have a maven multi module project designed like the first answer in following SO post: Multi-module maven with Spring Boot Now I want a common maven module that can contain some models to be used by multiple microservices. If I make this common project as a child of the first level parent pom (so that all dependencies injected by boot like jpa, jackson etc are available to common), then STS/Spring is detecting it as a boot application and complains about no Main class on maven build. Can

How to test Maven module project with Spring Boot

柔情痞子 提交于 2019-12-05 06:06:35
I have split a project, based on Spring Boot, into several Maven modules. Now only the war-project contains a starter class (having a main method, starting Spring), the other modules are of type jar. How do I test the jar projects, if they don't include a starter? Example JUnit test case header: @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(StarterClassInDifferentProject.class) ... I think context tests should be available per module so you can find issues with wire and configuration early on and not depend on your full application tests to find them. I worked around