Multiple projects with separate Git repo dependent on each other: how to create local builds?
I have several projects (Commons, ProjectA, ProjectB) in IntelliJ that each reside in their own Git repo. ProjectA and ProjectB depend on project Commons. When I change code in Commons I have to build Commons in GitLab, load the new version through artifactory into Intellij. Otherwise ProjectA and ProjectB in IntelliJ won't see the changes made in Commons. Also, when being in ProjectA or ProjectB and jumping into code defined in Commons IntelliJ opens up the jar of Commons it retrieved from Artifactory and decompiles it on the fly.
Question: What do I need to do, that I can build changes in Commons locally so that they become visible for ProjectA and ProjectB? What do I need to do that I jump to the source code of Commons when jumping to code of Commons called in ProjectA or ProjectB?
git maven intellij-idea build
add a comment |
I have several projects (Commons, ProjectA, ProjectB) in IntelliJ that each reside in their own Git repo. ProjectA and ProjectB depend on project Commons. When I change code in Commons I have to build Commons in GitLab, load the new version through artifactory into Intellij. Otherwise ProjectA and ProjectB in IntelliJ won't see the changes made in Commons. Also, when being in ProjectA or ProjectB and jumping into code defined in Commons IntelliJ opens up the jar of Commons it retrieved from Artifactory and decompiles it on the fly.
Question: What do I need to do, that I can build changes in Commons locally so that they become visible for ProjectA and ProjectB? What do I need to do that I jump to the source code of Commons when jumping to code of Commons called in ProjectA or ProjectB?
git maven intellij-idea build
1
Make a parent project with pom.xml defining the dependencies between these 3 projects. Import the root pom.xml in IntelliJ IDEA. Your 3 projects will become modules in IntelliJ IDEA and the dependencies will be resolved via module sources instead of the repository artifacts.
– CrazyCoder
Nov 28 '18 at 19:46
@CrazyCode: Thanks for your comment. With the change to micro services in our system we abandonned the approach of using parent poms ...
– OlliP
Nov 29 '18 at 10:40
add a comment |
I have several projects (Commons, ProjectA, ProjectB) in IntelliJ that each reside in their own Git repo. ProjectA and ProjectB depend on project Commons. When I change code in Commons I have to build Commons in GitLab, load the new version through artifactory into Intellij. Otherwise ProjectA and ProjectB in IntelliJ won't see the changes made in Commons. Also, when being in ProjectA or ProjectB and jumping into code defined in Commons IntelliJ opens up the jar of Commons it retrieved from Artifactory and decompiles it on the fly.
Question: What do I need to do, that I can build changes in Commons locally so that they become visible for ProjectA and ProjectB? What do I need to do that I jump to the source code of Commons when jumping to code of Commons called in ProjectA or ProjectB?
git maven intellij-idea build
I have several projects (Commons, ProjectA, ProjectB) in IntelliJ that each reside in their own Git repo. ProjectA and ProjectB depend on project Commons. When I change code in Commons I have to build Commons in GitLab, load the new version through artifactory into Intellij. Otherwise ProjectA and ProjectB in IntelliJ won't see the changes made in Commons. Also, when being in ProjectA or ProjectB and jumping into code defined in Commons IntelliJ opens up the jar of Commons it retrieved from Artifactory and decompiles it on the fly.
Question: What do I need to do, that I can build changes in Commons locally so that they become visible for ProjectA and ProjectB? What do I need to do that I jump to the source code of Commons when jumping to code of Commons called in ProjectA or ProjectB?
git maven intellij-idea build
git maven intellij-idea build
asked Nov 28 '18 at 16:47
OlliPOlliP
916716
916716
1
Make a parent project with pom.xml defining the dependencies between these 3 projects. Import the root pom.xml in IntelliJ IDEA. Your 3 projects will become modules in IntelliJ IDEA and the dependencies will be resolved via module sources instead of the repository artifacts.
– CrazyCoder
Nov 28 '18 at 19:46
@CrazyCode: Thanks for your comment. With the change to micro services in our system we abandonned the approach of using parent poms ...
– OlliP
Nov 29 '18 at 10:40
add a comment |
1
Make a parent project with pom.xml defining the dependencies between these 3 projects. Import the root pom.xml in IntelliJ IDEA. Your 3 projects will become modules in IntelliJ IDEA and the dependencies will be resolved via module sources instead of the repository artifacts.
– CrazyCoder
Nov 28 '18 at 19:46
@CrazyCode: Thanks for your comment. With the change to micro services in our system we abandonned the approach of using parent poms ...
– OlliP
Nov 29 '18 at 10:40
1
1
Make a parent project with pom.xml defining the dependencies between these 3 projects. Import the root pom.xml in IntelliJ IDEA. Your 3 projects will become modules in IntelliJ IDEA and the dependencies will be resolved via module sources instead of the repository artifacts.
– CrazyCoder
Nov 28 '18 at 19:46
Make a parent project with pom.xml defining the dependencies between these 3 projects. Import the root pom.xml in IntelliJ IDEA. Your 3 projects will become modules in IntelliJ IDEA and the dependencies will be resolved via module sources instead of the repository artifacts.
– CrazyCoder
Nov 28 '18 at 19:46
@CrazyCode: Thanks for your comment. With the change to micro services in our system we abandonned the approach of using parent poms ...
– OlliP
Nov 29 '18 at 10:40
@CrazyCode: Thanks for your comment. With the change to micro services in our system we abandonned the approach of using parent poms ...
– OlliP
Nov 29 '18 at 10:40
add a comment |
1 Answer
1
active
oldest
votes
You do not need to go through GitLab and Artifactory. If you build Commons with Maven on your local computer with version x.y.z-SNAPSHOT and reference it in ProjectA and ProjectB, they will pick up the changes automatically through the Maven local repository on your computer.
In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar.
For the comment of CrazyCoder: You could put all three projects into one multi-module project but this is not a technical but an architecture decision. If you want to always build those three projects together with the same version number, use multi-module, otherwise not.
Problem is that the maven build puts the created jar into the project's target dir. But ProjectA/ProjectB picks the jar from the local maven repo into dir x.y.z-SNAPSHOT-<timestamp>
– OlliP
Nov 29 '18 at 10:36
"In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar." That's the point :-). Am looking for IntelliJ for the same thing as in eclipse.
– OlliP
Nov 29 '18 at 10:36
" ... t but this is not a technical but an architecture decision". Yes, it's an architecture decision in my case from the architect ...
– OlliP
Nov 29 '18 at 10:38
If you runclean installwith Maven, the resulting jar will go to the local repository.m2/repositoryand is accessible by all other projects on the same computer.
– JF Meier
Nov 29 '18 at 11:57
@OlliP Have you tried?
– JF Meier
Dec 3 '18 at 14:00
|
show 2 more comments
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%2f53524326%2fmultiple-projects-with-separate-git-repo-dependent-on-each-other-how-to-create%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You do not need to go through GitLab and Artifactory. If you build Commons with Maven on your local computer with version x.y.z-SNAPSHOT and reference it in ProjectA and ProjectB, they will pick up the changes automatically through the Maven local repository on your computer.
In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar.
For the comment of CrazyCoder: You could put all three projects into one multi-module project but this is not a technical but an architecture decision. If you want to always build those three projects together with the same version number, use multi-module, otherwise not.
Problem is that the maven build puts the created jar into the project's target dir. But ProjectA/ProjectB picks the jar from the local maven repo into dir x.y.z-SNAPSHOT-<timestamp>
– OlliP
Nov 29 '18 at 10:36
"In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar." That's the point :-). Am looking for IntelliJ for the same thing as in eclipse.
– OlliP
Nov 29 '18 at 10:36
" ... t but this is not a technical but an architecture decision". Yes, it's an architecture decision in my case from the architect ...
– OlliP
Nov 29 '18 at 10:38
If you runclean installwith Maven, the resulting jar will go to the local repository.m2/repositoryand is accessible by all other projects on the same computer.
– JF Meier
Nov 29 '18 at 11:57
@OlliP Have you tried?
– JF Meier
Dec 3 '18 at 14:00
|
show 2 more comments
You do not need to go through GitLab and Artifactory. If you build Commons with Maven on your local computer with version x.y.z-SNAPSHOT and reference it in ProjectA and ProjectB, they will pick up the changes automatically through the Maven local repository on your computer.
In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar.
For the comment of CrazyCoder: You could put all three projects into one multi-module project but this is not a technical but an architecture decision. If you want to always build those three projects together with the same version number, use multi-module, otherwise not.
Problem is that the maven build puts the created jar into the project's target dir. But ProjectA/ProjectB picks the jar from the local maven repo into dir x.y.z-SNAPSHOT-<timestamp>
– OlliP
Nov 29 '18 at 10:36
"In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar." That's the point :-). Am looking for IntelliJ for the same thing as in eclipse.
– OlliP
Nov 29 '18 at 10:36
" ... t but this is not a technical but an architecture decision". Yes, it's an architecture decision in my case from the architect ...
– OlliP
Nov 29 '18 at 10:38
If you runclean installwith Maven, the resulting jar will go to the local repository.m2/repositoryand is accessible by all other projects on the same computer.
– JF Meier
Nov 29 '18 at 11:57
@OlliP Have you tried?
– JF Meier
Dec 3 '18 at 14:00
|
show 2 more comments
You do not need to go through GitLab and Artifactory. If you build Commons with Maven on your local computer with version x.y.z-SNAPSHOT and reference it in ProjectA and ProjectB, they will pick up the changes automatically through the Maven local repository on your computer.
In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar.
For the comment of CrazyCoder: You could put all three projects into one multi-module project but this is not a technical but an architecture decision. If you want to always build those three projects together with the same version number, use multi-module, otherwise not.
You do not need to go through GitLab and Artifactory. If you build Commons with Maven on your local computer with version x.y.z-SNAPSHOT and reference it in ProjectA and ProjectB, they will pick up the changes automatically through the Maven local repository on your computer.
In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar.
For the comment of CrazyCoder: You could put all three projects into one multi-module project but this is not a technical but an architecture decision. If you want to always build those three projects together with the same version number, use multi-module, otherwise not.
answered Nov 28 '18 at 20:08
JF MeierJF Meier
9,60442969
9,60442969
Problem is that the maven build puts the created jar into the project's target dir. But ProjectA/ProjectB picks the jar from the local maven repo into dir x.y.z-SNAPSHOT-<timestamp>
– OlliP
Nov 29 '18 at 10:36
"In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar." That's the point :-). Am looking for IntelliJ for the same thing as in eclipse.
– OlliP
Nov 29 '18 at 10:36
" ... t but this is not a technical but an architecture decision". Yes, it's an architecture decision in my case from the architect ...
– OlliP
Nov 29 '18 at 10:38
If you runclean installwith Maven, the resulting jar will go to the local repository.m2/repositoryand is accessible by all other projects on the same computer.
– JF Meier
Nov 29 '18 at 11:57
@OlliP Have you tried?
– JF Meier
Dec 3 '18 at 14:00
|
show 2 more comments
Problem is that the maven build puts the created jar into the project's target dir. But ProjectA/ProjectB picks the jar from the local maven repo into dir x.y.z-SNAPSHOT-<timestamp>
– OlliP
Nov 29 '18 at 10:36
"In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar." That's the point :-). Am looking for IntelliJ for the same thing as in eclipse.
– OlliP
Nov 29 '18 at 10:36
" ... t but this is not a technical but an architecture decision". Yes, it's an architecture decision in my case from the architect ...
– OlliP
Nov 29 '18 at 10:38
If you runclean installwith Maven, the resulting jar will go to the local repository.m2/repositoryand is accessible by all other projects on the same computer.
– JF Meier
Nov 29 '18 at 11:57
@OlliP Have you tried?
– JF Meier
Dec 3 '18 at 14:00
Problem is that the maven build puts the created jar into the project's target dir. But ProjectA/ProjectB picks the jar from the local maven repo into dir x.y.z-SNAPSHOT-<timestamp>
– OlliP
Nov 29 '18 at 10:36
Problem is that the maven build puts the created jar into the project's target dir. But ProjectA/ProjectB picks the jar from the local maven repo into dir x.y.z-SNAPSHOT-<timestamp>
– OlliP
Nov 29 '18 at 10:36
"In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar." That's the point :-). Am looking for IntelliJ for the same thing as in eclipse.
– OlliP
Nov 29 '18 at 10:36
"In Eclipse you could even open the three projects in the same workspace and all changes would be resolved automagically without running builds. But I do not know if IntelliJ offers something similar." That's the point :-). Am looking for IntelliJ for the same thing as in eclipse.
– OlliP
Nov 29 '18 at 10:36
" ... t but this is not a technical but an architecture decision". Yes, it's an architecture decision in my case from the architect ...
– OlliP
Nov 29 '18 at 10:38
" ... t but this is not a technical but an architecture decision". Yes, it's an architecture decision in my case from the architect ...
– OlliP
Nov 29 '18 at 10:38
If you run
clean install with Maven, the resulting jar will go to the local repository .m2/repository and is accessible by all other projects on the same computer.– JF Meier
Nov 29 '18 at 11:57
If you run
clean install with Maven, the resulting jar will go to the local repository .m2/repository and is accessible by all other projects on the same computer.– JF Meier
Nov 29 '18 at 11:57
@OlliP Have you tried?
– JF Meier
Dec 3 '18 at 14:00
@OlliP Have you tried?
– JF Meier
Dec 3 '18 at 14:00
|
show 2 more comments
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%2f53524326%2fmultiple-projects-with-separate-git-repo-dependent-on-each-other-how-to-create%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
1
Make a parent project with pom.xml defining the dependencies between these 3 projects. Import the root pom.xml in IntelliJ IDEA. Your 3 projects will become modules in IntelliJ IDEA and the dependencies will be resolved via module sources instead of the repository artifacts.
– CrazyCoder
Nov 28 '18 at 19:46
@CrazyCode: Thanks for your comment. With the change to micro services in our system we abandonned the approach of using parent poms ...
– OlliP
Nov 29 '18 at 10:40