2023 I need a Hello World Project for Maven Install Maven on Windows See the box below for Mac directions | Assignment Collections

Computer Science 2023 Java Advanced Maven Hello World Project

2023 I need a Hello World Project for Maven Install Maven on Windows See the box below for Mac directions | Assignment Collections

 I need a Hello World Project for Maven

  1. Install Maven on Windows (See the box below for Mac directions):
    1. Download the zip archive of latest version of Maven.  Be sure to download the binary zip, not the source (“src”) zip!
    2. Extract it to someplace.  I suggest C:Java (used in the directions that follow), but anyplace you wish is fine.
    3. I suggest you rename the folder from apache-maven-version to something simpler, such as just maven.
    4. Add this entry to the PATH environment variable: C:Javamavenbin (use the folder name you picked).
    5. Add this new environment variable: M2_HOME=C:Javamaven
    6. Make sure you have the following environment variable set: JAVA_HOME=C:java (or whatever location you used for the JDK).
    7. (As a reminder: PATH is used by your system to locate executables such as mvn or java; CLASSPATH is used by Java to locate packages and some other things; JAVA_HOME is used by various programs (including Maven) to locate a JDK; and M2_HOME (previously known as MAVEN_HOME) is used by mvn to locate various configuration files.  All of these may be used by other programs to locate files they need.  While some programs are smart enough to guess to try default install locations when you don’t set these variables, that won’t work if you don’t install in the default locations.)
      Install Maven on Mac OS X
      There are several ways do to this.  One is to follow the standard install directions for a Linux-like system, found on the Maven website.  The simplest way seems to be this:
    8. Install Homebrew if you don’t already have that: visit brew.sh, copy the long line shown, and paste it in a terminal window.  Doing this provides you with the brew command to install things.
    9. Run the command brew install maven.
    10. If your version of OS X doesn’t include the tree command, you can install that using the command brew install tree.
  2. First, pick (or create) an empty directory to hold your Maven projects, and cd into it.  Next, create a working “Hello, World” project named “hello” using the command (one long line):mvn archetype:generate -DgroupId=cop2805 -DartifactId=hello -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
    That might take a while the first time.  When done, see what files were created by using the tree/F hello command (just tree on Mac or Linux).  Also take a look in your home directory; you should see a new subdirectory there named .m2.  That’s your personal Maven repo.
  3. Next cd into your new hello directory.  Take a look at the generated source code at src/main/java/cop2805/App.java, the generated unit test atsrc/main/java/cop2805/App.java, and the generated pom.xml file.  (When using Maven “for real”, you would edit the POM file and then edit or replace the App.javaand AppTest.java files.)
  4. If using Java 9, you will need to add some lines to your pom.xml file.  The reason is, the current version of Maven’s compile plugin tries to generate code compatible with Java 5 (“javac -release 5 -source 5”), and Java 9 only supports Java 6 through 9.  To fix, you need to add these four lines in your generated pom.xml:  <properties>     <maven.compiler.source>1.9</maven.compiler.source>     <maven.compiler.target>1.9</maven.compiler.target>   </properties>
    Those lines can go anywhere between the initial <project> tag and the final </project> tag, but not inside of any other tags.  Just above the final </project> tag is fine.  (Hopefully, a new version of that plugin will address that problem!)
  5. Next, compile, test, package, and install your project.  Maven will automatically put a copy into your local repo, ~/.m2/ (“~” means your home directory.).  This is done with the simple command:mvn install
    Run the tree/F (or tree) command to see the new files created.  (Also look in your home directory and use tree on the .m2 directory there.)  Notice the JAR file; that is the resulting application.  To run this Jar file, enter the command (without changing directories first):
    java -cp targethello-1.0-SNAPSHOT.jar cop2805.App 
  6. Finally, there are a couple of other Maven commands to play with:
    • Try “mvn site” to generate a website for your project.  You can view the site in your web browser by opening the file “.../hello/target/site/”.
    • Convert your Maven project to an Eclipse-Maven project: “mvn eclipse:eclipse”.  If you import this project into Eclipse, it should just work.
    • Try to convert your “Hello, world” projects from the two IDEs into Maven projects.  Notice how the layout of folders is now different from the default for your Eclipse and NetBeans IDEs.

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational