avatar
getting started Spring Boot using Maven Spring Boot

There are some ways to create a Spring Boot project. We will go through some common ways as below:

• Using https://start.spring.io/ to generate project based on your specifications such as language, build tool, dependencies and custom some settings. Then it generates a ZIP file that you can download and import into your IDE of choice. 

• Using Maven command that generate a basic Maven project structure based on the specified archetype. Sometimes, you want to have a simple Java project structure and configure dependencies manually.

For example:

mvn archetype:generate -DgroupId=com.flagtick -DartifactId=flagticksolr -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -DarchetypeVersion=1.4

• Configuring dependencies manually. For example, this project is written served implementation of solr - Apache Lucene.

(*) pom.xml

<dependencies>
  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
    <scope>test</scope>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-solr</artifactId>
    <version>2.6.0</version>
  </dependency>
  <dependency>
    <groupId>org.apache.solr</groupId>
    <artifactId>solr-solrj</artifactId>
    <version>8.10.0</version>
  </dependency>
</dependencies>

To install external dependencies in a Maven project, simply add them and then execute the following command.

mvn install
24
You need to login to do this manipulation!