Gearsdf Gearsdfas
Gearsdf Gearsdfas

Reputation: 99

Create maven package

I am sorry but I am a complete noob on using maven. There is this .api library that I am trying to get updated and I just can't seem to grasp my head around maven at all.

On this site

It states to do a ‘mvn package’

Then add in the dependency and repositories.

Excuse me if I did this wrong as being that this was my first time.

With Eclipse I tried to create a maven project and select the downloaded folder as my location. Add in the dependency and repository. That failed miserably :( there were no errors but nothing happened on my eclipse. I tried to go maven > download sources. I get this warning*:

"There are no JREs installed in the workspace that are strictly compatible with this environment."

So without further ado I tried the basics of learning using maven on eclipse installing maven and merging it with eclipse. However the problem "Do a maven package" in which I then understood the basics but I still don't get it. How do you create a maven package within the project downloaded? if it was meant to be done that way...

I also tried just getting the updated source code and adding it to my project as a jar but the problem still persist since the source code requires items inside of it other than the jars it requested.(Less memory over the older version)

Now to my question:

  1. How do you create a maven project which then updates the project?
  2. Would it be better if I did the changes on Console of msdos or by eclipse?
  3. Can someone help me on doing this?(My mind is completely blown!)

Upvotes: 2

Views: 175

Answers (1)

Jean-Rémy Revy
Jean-Rémy Revy

Reputation: 5677

Question 1 : How do you create a maven project which then updates the project I don't understand what you mean. Could you be more explicit please ?

Question 2 : Would it be better if I did the changes on Console of msdos or by eclipse

For further uses, prefer maven in command line (this is closer to system and don't have any overlaying API). Moreover, it will learn you more things.

I was facing issues using eclipse integreted tools, that was not present in command line.

Question 3 : Can someone help me on doing this?(My mind is completely blown!) Did you tried to fill JAVA_HOME system variable ? For instance : C:\Program Files\Java\jdk1.6.0_31\

  • Which version or Maven are you using ?
  • Which version of Java are you using ?
  • Which version of Java are you using for running Eclipse (edit eclipse/eclipse.ini (if there nothing about it, it will use your default JVM defined in system variables) ?

Maven 3 require at least JRE 1.5 (1.6 is more often used).

More information here : http://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html


From the Maven Documentation :

Maven is a Java tool, so you must have Java installed in order to proceed. More precisely, you need a Java Development Kit (JDK), the Java Runtime Environment (JRE) is not sufficient.

Additional optional installation steps are listed after the platform specific instructions.

Windows 2000/XP

  • Unzip the distribution archive, i.e. apache-maven-3.0.4-bin.zip to the directory you wish to install Maven 3.0.4. These instructions assume you chose C:\Program Files\Apache Software Foundation. The subdirectory apache-maven-3.0.4 will be created from the archive.

  • Add the M2_HOME environment variable by opening up the system properties (WinKey + Pause), selecting the "Advanced" tab, and the "Environment Variables" button, then adding the M2_HOME variable in the user variables with the value C:\Program Files\Apache Software Foundation\apache-maven-3.0.4. Be sure to omit any quotation marks around the path even if it contains spaces. Note: For Maven < 2.0.9, also be sure that the M2_HOME doesn't have a '\' as last character.

  • In the same dialog, add the M2 environment variable in the user variables with the value %M2_HOME%\bin.

  • Optional: In the same dialog, add the MAVEN_OPTS environment variable in the user variables to specify JVM properties, e.g. the value -Xms256m -Xmx512m. This environment variable can be used to supply extra options to Maven.

  • In the same dialog, update/create the Path environment variable in the user variables and prepend the value %M2% to add Maven available in the command line.

  • In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. C:\Program Files\Java\jdk1.5.0_02 and that %JAVA_HOME%\bin is in your Path environment variable.

Open a new command prompt (Winkey + R then type cmd) and run mvn --version to verify that it is correctly installed.

Upvotes: 1

Related Questions