0

I have a jar file with source code. Our project has own Nexus repository. I want load this file to into this repository and get dependency tag for download it.

Can you describe the procedure ?

I want to write line in cmd

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
  • 1
    [mvn deploy:deploy-file](http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html) – Ori Dar Jun 02 '14 at 11:43

1 Answers1

1

You have to add a dependencies tag in your pom.xml :

<dependencies>
    <dependency>
        <groupId>org.yourgroupid</groupId>
        <artifactId>your-artifact-id</artifactId>
        <version>your-version</version>
    </dependency>
</dependencies>

And you have to add a repositories tag on which you will put your repository URL:

<repositories>
        <repository>
            <id>your-id</id>
            <url>http://your-url</url>
        </repository>
</repositories

Edit

Here is the way to deploy to your Nexus:

<distributionManagement>
        <repository>
            <id>nexus-repo</id>
            <url>http://your-nexus</url>
        </repository>
        <snapshotRepository>
            <id>nexus-snapshots</id>
            <url>http://your-nexus</url>
        </snapshotRepository>
</distributionManagement>

It can use scp or you may need to add wagon-plugin or cargo-plugin.

See more: http://maven.apache.org/pom.html#Distribution_Management

lpratlong
  • 1,421
  • 9
  • 17
  • I want to put jar into repo (not get) – gstackoverflow Jun 02 '14 at 11:52
  • So please, rewrite your question since it's not understandable. – lpratlong Jun 02 '14 at 11:53
  • I have misunderstanding in which pom.xml when I should to write – gstackoverflow Jun 02 '14 at 12:00
  • @gstackoverflow It depends on your project structure and on what you want to upload to your Nexus. I would say in your parent Pom since I do not have all the elements to answer. – lpratlong Jun 02 '14 at 12:02
  • **You have to add a dependencies tag in your pom.xml** is it in lib client? – gstackoverflow Jun 02 '14 at 12:36
  • **Here is the way to deploy to your Nexus** Should I write it in source pom of ja? – gstackoverflow Jun 02 '14 at 12:37
  • @gstackoverflow I do not understand what do you mean with "lib client". You have a `pom.xml` file, right? This is the Maven descriptor. It's in this file you have to write the code I gave you. So, yes, you have to write it in pom of your project (you will not put it in your JAR since you JAR is built by a Maven instruction. So it make no-sense). – lpratlong Jun 02 '14 at 12:41