In: Computer Science
Create a Maven project in NetBeans using the maven-archetype-quickstart template, with Group Id: com.lastname.firstname and Artifact Id: exam2p1.
2. Use search.maven.org and/or mvnrepository.com to find three different artifacts that you will demonstrate in your project. a. Each artifact you use should be in a different category (e.g. cloud, JSON, regex, etc.). Hint: You can search by category at mvnrepository.com. DO NOT USE any artifact we have already used in a project in-class assignments or demos. b. Make sure you can find enough documentation as to what each artifact does, so you are actually able to use its API in your project. There might be a Github repo or other website with the documentation – you may have to research this. If you cannot find sufficient documentation, choose another artifact.
3. Add the dependencies for all three chosen artifacts to your project.
4. Demonstrate at least 2 functionalities from each artifact in your program (use whatever imports, methods, and objects from each module as necessary). Show your results as output to the screen (if your demo includes file manipulation, state what happened as part of your program output, and include the result file(s) in your project’s directory for submission).
5. Fully comment on your program so someone can look at the code and understand quickly what it is about. Describe the purpose of each piece of code you use from the artifacts.
6. It should be obvious what your program is trying to do for anyone who reads the output. Suggestion: label each section of your output with the name of the artifact being demonstrated.
I need my code to be in Java Programming language with fully comment on the program?
$ mvn archetype:generate -DgroupId=com.journaldev.java -DartifactId=java-app -DarchetypeArtifactId=maven-archetype-quickstart [
INFO
] Scanning
for
projects... [
INFO
] [
INFO
] ------------------< org.apache.maven:standalone-pom >------------------- [
INFO
]
Building Maven Stub Project (No POM) 1 [INFO] --------------------------------[ pom ]--------------------------------- [INFO] [INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources @ standalone-pom <<< [INFO] [INFO] [INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.pom (703 B at 1.3 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-bundles/2/maven-archetype-bundles-2.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-bundles/2/maven-archetype-bundles-2.pom (1.5 kB at 2.8 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype-parent/1/maven-archetype-parent-1.pom Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/archetype/maven-archetype-parent/1/maven-archetype-parent-1.pom (1.3 kB at 2.5 kB/s) Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.jar Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/maven-archetype-quickstart-1.0.jar (4.3 kB at 7.9 kB/s) [INFO] Using property: groupId
= com.journaldev.java [
INFO
] Using property: artifactId = java-app Define
value
for
property
'version'
1.0
-SNAPSHOT: : [
INFO
] Using property: package = com.journaldev.java Confirm properties configuration: groupId: com.journaldev.java artifactId: java-app version:
1.0
-SNAPSHOT package: com.journaldev.java Y: : y [
INFO
] ---------------------------------------------------------------------------- [
INFO
]
Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-quickstart:1.0 [INFO] ---------------------------------------------------------------------------- [INFO] Parameter: basedir, Value: /Users/pankaj/Desktop/maven-examples [INFO] Parameter: package, Value: com.journaldev.java [INFO] Parameter: groupId, Value: com.journaldev.java [INFO] Parameter: artifactId, Value: java-app [INFO] Parameter: packageName, Value: com.journaldev.java [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] project created from Old (1.x) Archetype in dir: /Users/pankaj/Desktop/maven-examples/java-app [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 21.103 s [INFO] Finished at: 2019-12-05T13:23:58+05:30 [INFO] ------------------------------------------------------------------------
If you look at the output, the maven is confirming project configurations. We can skip this using the -DinteractiveMode=false argument.
Now, let's try to understand what is happening behind the scene of this command.
Archetype is a maven project templating toolkit. It's a great way to create maven projects from the command line. The archetype:generate tells maven that we have to generate a maven project from the additional information provided in the command.
Every maven project requires some specific configurations, such as groupId, artifactId, package.
For further information you can go to https://netbeans.org/kb/docs/javaee/maven-entapp.html