How to import multiple Spring application via maven where each dependency sits on its own classpath (to avoid...
I plan to bring in multiple Spring Boot Applications to a single module via maven dependecy so I can start them there for integration test purposes. How can I have those spring boot applications via maven so that they would have their own classpaths, and avoid dependency conflict? (each Spring boot application might use different spring versions)
java spring maven spring-boot
add a comment |
I plan to bring in multiple Spring Boot Applications to a single module via maven dependecy so I can start them there for integration test purposes. How can I have those spring boot applications via maven so that they would have their own classpaths, and avoid dependency conflict? (each Spring boot application might use different spring versions)
java spring maven spring-boot
I would take a look at testcontainers.org
– khmarbaise
Nov 23 '18 at 5:47
add a comment |
I plan to bring in multiple Spring Boot Applications to a single module via maven dependecy so I can start them there for integration test purposes. How can I have those spring boot applications via maven so that they would have their own classpaths, and avoid dependency conflict? (each Spring boot application might use different spring versions)
java spring maven spring-boot
I plan to bring in multiple Spring Boot Applications to a single module via maven dependecy so I can start them there for integration test purposes. How can I have those spring boot applications via maven so that they would have their own classpaths, and avoid dependency conflict? (each Spring boot application might use different spring versions)
java spring maven spring-boot
java spring maven spring-boot
asked Nov 23 '18 at 4:07
RyanRyan
2927
2927
I would take a look at testcontainers.org
– khmarbaise
Nov 23 '18 at 5:47
add a comment |
I would take a look at testcontainers.org
– khmarbaise
Nov 23 '18 at 5:47
I would take a look at testcontainers.org
– khmarbaise
Nov 23 '18 at 5:47
I would take a look at testcontainers.org
– khmarbaise
Nov 23 '18 at 5:47
add a comment |
2 Answers
2
active
oldest
votes
Build a snapshot Docker image for each of your bootsrap apps during their build (use maven docker plugin).
Run them using Docker Compose before integration tests and shut them down when tests are finished (docker or just exec maven plugin).
If you don't have an access to the code of those apps - you can create a multi-module maven project. Each module will get it's own bootstrap-app as a dependency. You can either build docker images here or just run apps separately before integration tests (each app in a separate module -> separate directory -> separate classpath) using maven plugins (e.g. - exec or jetty plugins).
I think the multi-module maven approach is more appealing to me. Once I have created a multi-module maven project, will it be possible for me to override each project's application.yml files? I would like to initialise some of the properties for testing purposes first, before starting them.
– Ryan
Nov 23 '18 at 6:14
add a comment |
You need a different pom.xml in order to have different versions of the same artifact among a whole application.
You could use dependencyManagement Maven tag.
You can skip the first part of the documentation, even tho it's interesting, and go directly to the
A second, and very important use of the dependency management section is to control the versions of artifacts used in transitive dependencies.
section.
Won't work. If one bootstrap app requires Spring 3 and another - Spring 5 - the firs won't start if you'll limit the Spring version to 5 only in dependencyManagement section
– Azee
Nov 23 '18 at 5:48
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440539%2fhow-to-import-multiple-spring-application-via-maven-where-each-dependency-sits-o%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Build a snapshot Docker image for each of your bootsrap apps during their build (use maven docker plugin).
Run them using Docker Compose before integration tests and shut them down when tests are finished (docker or just exec maven plugin).
If you don't have an access to the code of those apps - you can create a multi-module maven project. Each module will get it's own bootstrap-app as a dependency. You can either build docker images here or just run apps separately before integration tests (each app in a separate module -> separate directory -> separate classpath) using maven plugins (e.g. - exec or jetty plugins).
I think the multi-module maven approach is more appealing to me. Once I have created a multi-module maven project, will it be possible for me to override each project's application.yml files? I would like to initialise some of the properties for testing purposes first, before starting them.
– Ryan
Nov 23 '18 at 6:14
add a comment |
Build a snapshot Docker image for each of your bootsrap apps during their build (use maven docker plugin).
Run them using Docker Compose before integration tests and shut them down when tests are finished (docker or just exec maven plugin).
If you don't have an access to the code of those apps - you can create a multi-module maven project. Each module will get it's own bootstrap-app as a dependency. You can either build docker images here or just run apps separately before integration tests (each app in a separate module -> separate directory -> separate classpath) using maven plugins (e.g. - exec or jetty plugins).
I think the multi-module maven approach is more appealing to me. Once I have created a multi-module maven project, will it be possible for me to override each project's application.yml files? I would like to initialise some of the properties for testing purposes first, before starting them.
– Ryan
Nov 23 '18 at 6:14
add a comment |
Build a snapshot Docker image for each of your bootsrap apps during their build (use maven docker plugin).
Run them using Docker Compose before integration tests and shut them down when tests are finished (docker or just exec maven plugin).
If you don't have an access to the code of those apps - you can create a multi-module maven project. Each module will get it's own bootstrap-app as a dependency. You can either build docker images here or just run apps separately before integration tests (each app in a separate module -> separate directory -> separate classpath) using maven plugins (e.g. - exec or jetty plugins).
Build a snapshot Docker image for each of your bootsrap apps during their build (use maven docker plugin).
Run them using Docker Compose before integration tests and shut them down when tests are finished (docker or just exec maven plugin).
If you don't have an access to the code of those apps - you can create a multi-module maven project. Each module will get it's own bootstrap-app as a dependency. You can either build docker images here or just run apps separately before integration tests (each app in a separate module -> separate directory -> separate classpath) using maven plugins (e.g. - exec or jetty plugins).
answered Nov 23 '18 at 5:46
AzeeAzee
1,4841319
1,4841319
I think the multi-module maven approach is more appealing to me. Once I have created a multi-module maven project, will it be possible for me to override each project's application.yml files? I would like to initialise some of the properties for testing purposes first, before starting them.
– Ryan
Nov 23 '18 at 6:14
add a comment |
I think the multi-module maven approach is more appealing to me. Once I have created a multi-module maven project, will it be possible for me to override each project's application.yml files? I would like to initialise some of the properties for testing purposes first, before starting them.
– Ryan
Nov 23 '18 at 6:14
I think the multi-module maven approach is more appealing to me. Once I have created a multi-module maven project, will it be possible for me to override each project's application.yml files? I would like to initialise some of the properties for testing purposes first, before starting them.
– Ryan
Nov 23 '18 at 6:14
I think the multi-module maven approach is more appealing to me. Once I have created a multi-module maven project, will it be possible for me to override each project's application.yml files? I would like to initialise some of the properties for testing purposes first, before starting them.
– Ryan
Nov 23 '18 at 6:14
add a comment |
You need a different pom.xml in order to have different versions of the same artifact among a whole application.
You could use dependencyManagement Maven tag.
You can skip the first part of the documentation, even tho it's interesting, and go directly to the
A second, and very important use of the dependency management section is to control the versions of artifacts used in transitive dependencies.
section.
Won't work. If one bootstrap app requires Spring 3 and another - Spring 5 - the firs won't start if you'll limit the Spring version to 5 only in dependencyManagement section
– Azee
Nov 23 '18 at 5:48
add a comment |
You need a different pom.xml in order to have different versions of the same artifact among a whole application.
You could use dependencyManagement Maven tag.
You can skip the first part of the documentation, even tho it's interesting, and go directly to the
A second, and very important use of the dependency management section is to control the versions of artifacts used in transitive dependencies.
section.
Won't work. If one bootstrap app requires Spring 3 and another - Spring 5 - the firs won't start if you'll limit the Spring version to 5 only in dependencyManagement section
– Azee
Nov 23 '18 at 5:48
add a comment |
You need a different pom.xml in order to have different versions of the same artifact among a whole application.
You could use dependencyManagement Maven tag.
You can skip the first part of the documentation, even tho it's interesting, and go directly to the
A second, and very important use of the dependency management section is to control the versions of artifacts used in transitive dependencies.
section.
You need a different pom.xml in order to have different versions of the same artifact among a whole application.
You could use dependencyManagement Maven tag.
You can skip the first part of the documentation, even tho it's interesting, and go directly to the
A second, and very important use of the dependency management section is to control the versions of artifacts used in transitive dependencies.
section.
edited Nov 23 '18 at 5:09
answered Nov 23 '18 at 4:59
Vincent C.Vincent C.
13
13
Won't work. If one bootstrap app requires Spring 3 and another - Spring 5 - the firs won't start if you'll limit the Spring version to 5 only in dependencyManagement section
– Azee
Nov 23 '18 at 5:48
add a comment |
Won't work. If one bootstrap app requires Spring 3 and another - Spring 5 - the firs won't start if you'll limit the Spring version to 5 only in dependencyManagement section
– Azee
Nov 23 '18 at 5:48
Won't work. If one bootstrap app requires Spring 3 and another - Spring 5 - the firs won't start if you'll limit the Spring version to 5 only in dependencyManagement section
– Azee
Nov 23 '18 at 5:48
Won't work. If one bootstrap app requires Spring 3 and another - Spring 5 - the firs won't start if you'll limit the Spring version to 5 only in dependencyManagement section
– Azee
Nov 23 '18 at 5:48
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53440539%2fhow-to-import-multiple-spring-application-via-maven-where-each-dependency-sits-o%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I would take a look at testcontainers.org
– khmarbaise
Nov 23 '18 at 5:47