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

后端 未结 4 918
甜味超标
甜味超标 2020-12-08 04:52

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\

相关标签:
4条回答
  • 2020-12-08 05:19

    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

    0 讨论(0)
  • 2020-12-08 05:20

    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

    0 讨论(0)
  • 2020-12-08 05:22

    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 :)

    0 讨论(0)
  • 2020-12-08 05:38

    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

    0 讨论(0)
提交回复
热议问题