This article is a mirror article of machine translation, please click here to jump to the original article.

View: 1100|Reply: 1

[Source] Create a simple Maven console project

[Copy link]
Posted on 2025-3-19 17:31:56 | | | |
Requirements: Create a Maven console project to test your code.

Download and install the configuration tutorial for Windows Maven
https://www.itsvse.com/thread-10755-1-1.html

The command is as follows:



Parameters introduction

1. mvn archetype:generate
This is a command in Maven that is used to generate a new Maven project based on the specified archetype. Archetype is a template mechanism provided by Maven that allows for quick project creation based on a predefined structure.

2. -DgroupId=com.example
Meaning: Specify the Group ID of the project.
Role: Group IDs are often used to identify organizations or companies, similar to the namespace of Java package names. For example, com.example means that the project belongs to the com domain under the example organization.
Example: If your company is mycompany, you can set it to com.mycompany.

3. -DartifactId=JavaSmConsoleApp
Meaning: Specifies the Artifact ID of the project.
Function: Artifact ID is the core name of a project, often used to distinguish specific project modules or applications.
Example: In this example, the name of the project will be JavaSmConsoleApp.

4. -DarchetypeArtifactId=maven-archetype-quickstart
Meaning: Specifies the Maven Archetype to use.
Function: maven-archetype-quickstart is a standard archetype provided by Maven for generating a simple Java project with a basic directory structure and an example class.
Other Archetypes: If you need a more complex project structure, you can choose other Archetypes, such as:
maven-archetype-webapp: 用于生成 Web 应用程序。
maven-archetype-j2ee-simple: 用于生成简单的 J2EE 项目。

5. -DinteractiveMode=false
Meaning: Disable interaction mode.
Function: By default, mvn archetype:generate runs in interactive mode, prompting users to enter information such as Group ID, Artifact ID, etc. By setting -DinteractiveMode=false, these parameters can be specified directly on the command line, avoiding interactive input.
Scenarios: Disabling interaction mode is useful when you need to automate the construction of scripts.




Previous:[AI] (12) Use infinity to deploy embedding models
Next:[AI] (13) A brief introduction to vector similarity and distance
 Landlord| Posted on 2025-4-8 14:21:50 |
maven generates a dependency-free .jar and a .jar package with dependencies, pom.xml configured as follows:

Command:
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com