Dinesh
Dinesh

Reputation: 1128

How to install jars in maven repository which is eclipse embedded?

My objective is to install a jar file in a Maven repository. This post explains how to do an install with MVN.

But but since I have Maven embedded in Eclipse, I don't know where to run the following command:

mvn install:install-file  -Dfile=C:\lib\rest\WadlGenerator.jar \
                          -DgroupId=foo.in.shop.rest.wadl \
                          -DartifactId=WadlGenerator \
                          -Dversion=1.0 \
                          -Dpackaging=jar \
                          -DlocalRepositoryPath=C:\maven\repositories\internal

In short: How can I identify the Maven installation directory for Eclipse-embedded Maven?

Upvotes: 26

Views: 70342

Answers (4)

Divya Bansal
Divya Bansal

Reputation: 105

Or you can simply do: 1. Run 2. Maven Build.. 3. Copy the whole command in Goals i.e.

install:install-file  -Dfile=C:\lib\rest\WadlGenerator.jar \
                          -DgroupId=foo.in.shop.rest.wadl \
                          -DartifactId=WadlGenerator \
                          -Dversion=1.0 \
                          -Dpackaging=jar \
                          -DlocalRepositoryPath=C:\maven\repositories\internal 
  1. Run

This is much easier than filling keys and values :D

Upvotes: 8

user281806
user281806

Reputation: 1030

If you have M2Eclipse installed, and you have a Maven pom building the jar, use

Run -> Run As... -> Maven Install

from the Eclipse menu to do the equivalient of mvn install

Upvotes: 3

Goibniu
Goibniu

Reputation: 2221

The default location for the maven repository would be ~/.m2/repository.

Unless you changed this in the preferences of your eclipse plugin, then you should go with that. Replace the ~/ with whatever is appropriate for your home dir on your OS.

Edit: Updating based on the comments: There's an online book available for the m2eclipse plugin, and it would appear that you can run goals from the m2eclipse plugin - see the section here: m2eclipse Goals

I presume there is a wizard of some sort when you click on the goal - I don't have m2eclipse installed here.

Edit2: actually looking at the other answer, this has been answered already :)

Upvotes: 1

darwin
darwin

Reputation: 364

From eclipse you can do:

Run -> Run Configurations -> Maven Build (double click)

Your goal is install:install-file

And also you should fill parameters' keys and values

P. S. But I think that it is more better to have external maven installation in system

Upvotes: 32

Related Questions