spring boot: maven command to download all dependencies - spring

In a spring boot project I would like to download all dependencies before starting the application.
When I run "mvn compile" first, it is downloading a lot of dependecies. But when I run "mvn spring-boot:run" after that, it still downloads tons of dependecies.
So what is the right way to download all dependecies like spring-boot:run does - but without running the application?
Thank you!

Try running maven with -o switch to run your maven command in offline mode. This will use already downloaded dependencies in the local repository.

Related

Cannot every time use internet for downloading spring-boot-starter-parent-2.3.3.RELEASE.pom from central

Is there any mechanism that if i keep all the pom dependencies locally at some path that everytime it gets picked from that path when i run Spring Boot app from command line?
Example: Everytime i dont't want to donwload the pom dependencies from repository as below and want to keep somewhere locally for use.
Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.3.3.RELEASE/spring-boot-starter-parent-2.3.3.RELEASE.pom
I feel your question is a bit strange because it describes the main feature of maven.
When building a project with maven, all the dependencies required by your project are downloaded into a local repository. Future builds won't download again those dependencies.
When running a springboot application using maven, the downloaded dependencies are provided to the application's classpath so they aren't downloaded again.
When running a packaged springboot application, the dependencies are already inserted in the springboot fat jar so they aren't downloaded again.
Another point, if you want to ensure maven does not download anything you can execute maven in "offline mode" using the following parameter "-o"

Can't build project through intellij-idea with maven, but through console command "mvn package" build successful

I got a project written in java EE 5.
I use:
Java 7
Maven 3.5.4
idea 2018.2.5x64
When you build a project through idea, the project is not built.
enter image description here
But when I run the mvn package through console, the process completes successfully
Help me please for this issue.
Try to update your maven dependencies in Intellij. Usually you should see a prompt asking you to do that.
Read this for more details on updating dependencies: How can I make IntelliJ IDEA update my dependencies from Maven?

Show Logback error when I run Simple Spring Boot project

I follow this tutorial to create spring boot project, when I run the project, it shows an error. Please help me to fix it.
my pom.xml
You mentioned that it worked with gradle but not Maven.
One possible solution is to delete your local maven repository to force it to redownload the dependencies:
Go to your home folder and remove the folder ~/.m2/repository.
Then, try rebuilding your project with maven : mvn clean install
I try to update Java and Maven,but it also do not work,and then I change Maven to Gradle,the application can run! Maybe Maven has problem.

Can Jenkins issue a "maven jboss-as:deploy" on my project?

I am trying to use Jenkins and Selenium for CI with my Spring Project that I will be running in AS7.
I would like to know if I can get Jenkins to issue a "maven jboss-as:deploy" command line on my project to deploy it to my AS7 server.
Can someone please let me know if this can be done..
No need to involve Jenkins here. Just add the jboss-as:deploy plugin to your pom.xml, bound to the pre-integration-test phase of your build. Then when you run mvn install (either locally or on Jenkins), your war will be deployed to the AS7 server.

Using maven jetty plugin in multi-module project under Eclipse

I am working on a simple multi module maven project under Eclipse using m2eclipse with maven 3 and jetty plugin version 7. One of my module is a jar and the other module is a war which has a dependency on the jar.
Even though the workspace dependency resolution is enabled, the call to mvn jetty:run fails if I don't run mvn install before.
Having read about workspace dependency, I am not sure why a call to mvn install is required. I would like to be able to run the jetty plugin without installing the artifacts to my local repository. Is it possible?
Thanks in advance.
There is an integration module between m2eclipse and the WTP (Web Tool Platform).
WTP allow starting Jetty/Tomcat/... from Eclipse, debugging inside Eclipse, redeploy on change,...
Here is it: m2eclipse Extras

Resources