windows script for building multimodule maven project - windows

I'm trying to create a .bat file for automatic building of a multimodule maven project, the script is :
mvn clean install
cd ./webapp
mvn jetty:run-war
However, the first line seem to close the console window, so I never get to the last line. Thank you in advance.

call mvn clean install
cd ./webapp
call mvn jetty:run-war

Related

Spring change application.properties location using mvn clean install

Im a bit confused about this.
Im creating a script that build my project, but I need to specify the location of the application properties while using mvn clean install.
There exists something like mvn clean install -propLocation=/some_path/application.properties?

mvn install running before package

So I have a parent maven project with a few child modules. All child projects generate jars and have dependencies. As part of the package phase, following are done
Compiled jars are copied to a lib directory
Dependencies are copied to a extlib directory
A tar.gz package is created in the end (I am worried about the order as assembly is done in parent while copy is done in child project poms)
Once packaging is complete, I want to install the package on a remote server, so I have then antrun plugin which takes care of it, inside install phase.
The problem is that I cannot control the order in which things are done. I would like to keep the responsibilities separate but if I run the command: mvn clean package install, it will run the install phase first which I think is because it is part of parent pom deployment which is done first. I have to run it in two commands i.e. mvn clean package and then mvn install to make sure latest is deployed.
Is there anyway to run this install phase at the end when packaging is done?

<Maven> How is the command "mvn dependency:resolve" different from "mvn clean install"?

I would like to ask about the use of the command "mvn dependency:resolve". When I executed the command in project folder, it seems it download jars and build the application. I wonder if it has the same functions as "mvn clean install". Thanks.
Install will compile, test & package your Java project and even install/copy your built .jar/.war file into your local Maven repository.
But dependency:resolve compile your application and print resolved dependencies.

Maven install excluding specific modules

I am installing this project with several modules. The goal is to install all modules EXCEPT the nd4j-cuda module. If I run this:
mvn clean install -pl ':nd4j-cuda-8.0'
then maven attempts to install the module, no errors are thrown detecting it. However, since I actually do NOT want to install it, I tried
mvn clean install -pl '!:nd4j-cuda-8.0'
but I get the error message
Could not find the selected project in the reactor: !:nd4j-cuda-8.0
What am I doing wrong here?
I try with groupId:
mvn clean -pl '!org.nd4j:nd4j-cuda-8.0'
also
mvn clean -pl '!:nd4j-cuda-8.0'
give teh same result.
My maven version is: 3.3.3
With maven version 3.0.5 I have the same error as you, so please use newer version of maven.

Differences between maven archetype commands and maven command mvn package?

Could somebody tells me, what are the differences between the command mvn archetype:generate and the commands mvn clean package or mvn clean install.
Thanks a lot!
Maik
archetype:generate generates a brand new project from a template
clean package clean and package the project
clean install clean, package the project and install it into the local repo. (i.e. ~/.m2/repository)
For more info, see the documentation

Resources