Build sibling projects when running mvn install












1















We have a project that recently switched from ant and crappy CLI tools to maven,

our current structure is:



- parent
- main-project:
- sub-module-A:
- sub-module-B:


Each one of these projects is in it's own repository and they are linked through pom files
parent has all three projects defined in tags and main-project defines both sub modules as dependencies.



the issue at hand:

Since main-project is where I deploy the site (in this case) I want to make sure that the sources of both modules are updated when I run it which means I want to compile if needed both sub modules when I run mvn install on the main-project.



I tried using mvn-exec-plugin to build both but it's not actually building anything.



Any idea how to fix this?



edit: I am running mvn appengine:run from main-project and want the sources from sub-modules A and B to install if needed










share|improve this question

























  • Are you executing the site phase in the Maven command, e.g. mvn install site?

    – user944849
    Nov 21 '18 at 14:00











  • executing appengine:run

    – thepoosh
    Nov 21 '18 at 14:02











  • appengine:run is what Maven calls a goal, where install and site are phases. Phases can be configured to run multiple goals in a specific order. You may need to figure out how to tie the appengine:run into the app's POM so it runs at the proper point in the larger phase, or perhaps run multiple Maven commands (e.g. mvn appengine:run site). Google 'maven lifecycle' for more detail, the docs are decent. I don't know enough about the appengine plugin to provide more guidance.

    – user944849
    Nov 21 '18 at 18:08


















1















We have a project that recently switched from ant and crappy CLI tools to maven,

our current structure is:



- parent
- main-project:
- sub-module-A:
- sub-module-B:


Each one of these projects is in it's own repository and they are linked through pom files
parent has all three projects defined in tags and main-project defines both sub modules as dependencies.



the issue at hand:

Since main-project is where I deploy the site (in this case) I want to make sure that the sources of both modules are updated when I run it which means I want to compile if needed both sub modules when I run mvn install on the main-project.



I tried using mvn-exec-plugin to build both but it's not actually building anything.



Any idea how to fix this?



edit: I am running mvn appengine:run from main-project and want the sources from sub-modules A and B to install if needed










share|improve this question

























  • Are you executing the site phase in the Maven command, e.g. mvn install site?

    – user944849
    Nov 21 '18 at 14:00











  • executing appengine:run

    – thepoosh
    Nov 21 '18 at 14:02











  • appengine:run is what Maven calls a goal, where install and site are phases. Phases can be configured to run multiple goals in a specific order. You may need to figure out how to tie the appengine:run into the app's POM so it runs at the proper point in the larger phase, or perhaps run multiple Maven commands (e.g. mvn appengine:run site). Google 'maven lifecycle' for more detail, the docs are decent. I don't know enough about the appengine plugin to provide more guidance.

    – user944849
    Nov 21 '18 at 18:08
















1












1








1








We have a project that recently switched from ant and crappy CLI tools to maven,

our current structure is:



- parent
- main-project:
- sub-module-A:
- sub-module-B:


Each one of these projects is in it's own repository and they are linked through pom files
parent has all three projects defined in tags and main-project defines both sub modules as dependencies.



the issue at hand:

Since main-project is where I deploy the site (in this case) I want to make sure that the sources of both modules are updated when I run it which means I want to compile if needed both sub modules when I run mvn install on the main-project.



I tried using mvn-exec-plugin to build both but it's not actually building anything.



Any idea how to fix this?



edit: I am running mvn appengine:run from main-project and want the sources from sub-modules A and B to install if needed










share|improve this question
















We have a project that recently switched from ant and crappy CLI tools to maven,

our current structure is:



- parent
- main-project:
- sub-module-A:
- sub-module-B:


Each one of these projects is in it's own repository and they are linked through pom files
parent has all three projects defined in tags and main-project defines both sub modules as dependencies.



the issue at hand:

Since main-project is where I deploy the site (in this case) I want to make sure that the sources of both modules are updated when I run it which means I want to compile if needed both sub modules when I run mvn install on the main-project.



I tried using mvn-exec-plugin to build both but it's not actually building anything.



Any idea how to fix this?



edit: I am running mvn appengine:run from main-project and want the sources from sub-modules A and B to install if needed







maven mvn-repo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 14:04







thepoosh

















asked Nov 21 '18 at 13:45









thepooshthepoosh

9,3771359119




9,3771359119













  • Are you executing the site phase in the Maven command, e.g. mvn install site?

    – user944849
    Nov 21 '18 at 14:00











  • executing appengine:run

    – thepoosh
    Nov 21 '18 at 14:02











  • appengine:run is what Maven calls a goal, where install and site are phases. Phases can be configured to run multiple goals in a specific order. You may need to figure out how to tie the appengine:run into the app's POM so it runs at the proper point in the larger phase, or perhaps run multiple Maven commands (e.g. mvn appengine:run site). Google 'maven lifecycle' for more detail, the docs are decent. I don't know enough about the appengine plugin to provide more guidance.

    – user944849
    Nov 21 '18 at 18:08





















  • Are you executing the site phase in the Maven command, e.g. mvn install site?

    – user944849
    Nov 21 '18 at 14:00











  • executing appengine:run

    – thepoosh
    Nov 21 '18 at 14:02











  • appengine:run is what Maven calls a goal, where install and site are phases. Phases can be configured to run multiple goals in a specific order. You may need to figure out how to tie the appengine:run into the app's POM so it runs at the proper point in the larger phase, or perhaps run multiple Maven commands (e.g. mvn appengine:run site). Google 'maven lifecycle' for more detail, the docs are decent. I don't know enough about the appengine plugin to provide more guidance.

    – user944849
    Nov 21 '18 at 18:08



















Are you executing the site phase in the Maven command, e.g. mvn install site?

– user944849
Nov 21 '18 at 14:00





Are you executing the site phase in the Maven command, e.g. mvn install site?

– user944849
Nov 21 '18 at 14:00













executing appengine:run

– thepoosh
Nov 21 '18 at 14:02





executing appengine:run

– thepoosh
Nov 21 '18 at 14:02













appengine:run is what Maven calls a goal, where install and site are phases. Phases can be configured to run multiple goals in a specific order. You may need to figure out how to tie the appengine:run into the app's POM so it runs at the proper point in the larger phase, or perhaps run multiple Maven commands (e.g. mvn appengine:run site). Google 'maven lifecycle' for more detail, the docs are decent. I don't know enough about the appengine plugin to provide more guidance.

– user944849
Nov 21 '18 at 18:08







appengine:run is what Maven calls a goal, where install and site are phases. Phases can be configured to run multiple goals in a specific order. You may need to figure out how to tie the appengine:run into the app's POM so it runs at the proper point in the larger phase, or perhaps run multiple Maven commands (e.g. mvn appengine:run site). Google 'maven lifecycle' for more detail, the docs are decent. I don't know enough about the appengine plugin to provide more guidance.

– user944849
Nov 21 '18 at 18:08














1 Answer
1






active

oldest

votes


















2














Assuming your main-project has dependencies on sub-module-A and sub-module-B and the parent has all projects as modules, i. e.



parent



<modules>
<module>main-project</module>
<module>sub-module-A</module>
<module>sub-module-B</module>
<modules>


main-project



<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-A</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-B</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>


Then, you can build the parent project with



mvn --projects :main-project --also-make install


or using shortcuts for the options



mvn -pl :main-project -am install


With these options only the main-project and all its dependencies (which are somewhere in the parent's modules) are built.



See this and this for more information.






share|improve this answer
























  • question is can I run appengine:run from main-project and install sub-modules A and B?

    – thepoosh
    Nov 21 '18 at 14:03











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413467%2fbuild-sibling-projects-when-running-mvn-install%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









2














Assuming your main-project has dependencies on sub-module-A and sub-module-B and the parent has all projects as modules, i. e.



parent



<modules>
<module>main-project</module>
<module>sub-module-A</module>
<module>sub-module-B</module>
<modules>


main-project



<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-A</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-B</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>


Then, you can build the parent project with



mvn --projects :main-project --also-make install


or using shortcuts for the options



mvn -pl :main-project -am install


With these options only the main-project and all its dependencies (which are somewhere in the parent's modules) are built.



See this and this for more information.






share|improve this answer
























  • question is can I run appengine:run from main-project and install sub-modules A and B?

    – thepoosh
    Nov 21 '18 at 14:03
















2














Assuming your main-project has dependencies on sub-module-A and sub-module-B and the parent has all projects as modules, i. e.



parent



<modules>
<module>main-project</module>
<module>sub-module-A</module>
<module>sub-module-B</module>
<modules>


main-project



<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-A</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-B</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>


Then, you can build the parent project with



mvn --projects :main-project --also-make install


or using shortcuts for the options



mvn -pl :main-project -am install


With these options only the main-project and all its dependencies (which are somewhere in the parent's modules) are built.



See this and this for more information.






share|improve this answer
























  • question is can I run appengine:run from main-project and install sub-modules A and B?

    – thepoosh
    Nov 21 '18 at 14:03














2












2








2







Assuming your main-project has dependencies on sub-module-A and sub-module-B and the parent has all projects as modules, i. e.



parent



<modules>
<module>main-project</module>
<module>sub-module-A</module>
<module>sub-module-B</module>
<modules>


main-project



<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-A</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-B</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>


Then, you can build the parent project with



mvn --projects :main-project --also-make install


or using shortcuts for the options



mvn -pl :main-project -am install


With these options only the main-project and all its dependencies (which are somewhere in the parent's modules) are built.



See this and this for more information.






share|improve this answer













Assuming your main-project has dependencies on sub-module-A and sub-module-B and the parent has all projects as modules, i. e.



parent



<modules>
<module>main-project</module>
<module>sub-module-A</module>
<module>sub-module-B</module>
<modules>


main-project



<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-A</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>sub-module-B</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>


Then, you can build the parent project with



mvn --projects :main-project --also-make install


or using shortcuts for the options



mvn -pl :main-project -am install


With these options only the main-project and all its dependencies (which are somewhere in the parent's modules) are built.



See this and this for more information.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 13:58









SilverNakSilverNak

2,32521525




2,32521525













  • question is can I run appengine:run from main-project and install sub-modules A and B?

    – thepoosh
    Nov 21 '18 at 14:03



















  • question is can I run appengine:run from main-project and install sub-modules A and B?

    – thepoosh
    Nov 21 '18 at 14:03

















question is can I run appengine:run from main-project and install sub-modules A and B?

– thepoosh
Nov 21 '18 at 14:03





question is can I run appengine:run from main-project and install sub-modules A and B?

– thepoosh
Nov 21 '18 at 14:03




















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53413467%2fbuild-sibling-projects-when-running-mvn-install%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

Npm cannot find a required file even through it is in the searched directory