0

I have a remote http:// link which directly downloads a .jar file from a remote server (team city server). I'd like to be able to use this link to download and install this .jar file as a library to a fresh maven project I have created in Intellij.

The guides & solutions I've found show me how to do this manually which works fine in its own way, but I want a remote one for my latest build so that the library keeps up to date with the latest version (if the user desires).

Is this possible?

Kyle
  • 43
  • 1
  • 6
  • Since maven does checks on the signature and sanctity of the downloads, you cannot directly access it and need to have a private maven repository, More details: at the solutions in this query https://stackoverflow.com/questions/12410423/how-do-i-setup-a-private-remotely-accessible-maven-repository – pradosh nair Sep 17 '19 at 02:21

1 Answers1

1

Since maven does checks on the signature and sanctity of the downloads, you cannot directly access the url as you are suggesting and need to have a maven repository, More details: at the best maven repository refer this query. How do I setup a private, remotely accessible Maven repository?

<distributionManagement>
<snapshotRepository>
    <id>...</id>
    <url>http:...</url>
</snapshotRepository>

You need to essentially use the install goal to push the jar to the repository and use the <repositories> in the dependent maven projects to point to the hosted maven repository

<repositories>
    <repository>
      <id>my-internal-site</id>
      <url>http://myserver/repo</url>
    </repository>
</repositories>
pradosh nair
  • 913
  • 1
  • 16
  • 28
  • Thanks for that. I was worried that was the case. Unfortunately my company is using TeamCity as a build server for the artifacts so I can't jump to a maven repo. I'd ideally like to use maven in the project to get it working since most of my company uses maven, but that doesn't seem to be possible anymore. Do you have any tips on other types I could use to connect to my private TeamCity server? e.g. Gradle. I'm not familiar with a lot of this. – Kyle Sep 17 '19 at 03:00
  • Team City can build your application in such a manner that the jar gets deployed into maven repo, They normally work in tandem. I remember doing this before. Haven't worked much on gradle, – pradosh nair Sep 17 '19 at 05:14