2

To create a public maven repository, I create a local folder (e.g., $HOME/maven-repo) that is kept synched to a public folder at my web server. To install a jar at such repository, I do

mvn install:install-file -DgroupId=[groupId] -DartifactId=[artifactId] -Dversion=[version] -Dpackaging=jar -Dfile=[pathToJar] -DlocalRepositoryPath=$HOME/maven-repo -DcreateChecksum=true

and then I synchronize the $HOME/maven-repo with the webserver.

However, this creates file maven-metadata-local.xml (at $HOME/maven-repo/[groupId]/[artifactId]). From what I understand, this is correct only if the repository is local. If it's online it should be just maven-metadata.xml. Of course I could just rename the files, but I guess there's a more correct way of doing this.

The question is: how do I create such public maven repository properly, i.e., with the files just as maven-metadata.xml with no "local" in the filenames, without resorting to rename the files by hand?

Eduardo Bezerra
  • 1,923
  • 1
  • 17
  • 32
  • 1
    Why not use an artifact repository manager such as Nexus, Artifactory or Archiva...? – carlspring Mar 04 '15 at 13:20
  • Unfortunately i dont know how to create a **remote** repository but since Maven only knows about **local** and **remote** repositories `mvn install` will always _install/move_ artefacts to a local repository while `mvn deploy` will attempt to _deploy/move_ the artefacts to a remote repository. So as soon as you have setup the remote repository (with whatever configuration it takes to allow it) you will be able to _deploy_ your artefact to whoever has access to that remote repository by calling `mvn deploy` (includes `mvn install`) – JBA Mar 04 '15 at 14:15
  • @carlspring Because I want to use only fully free tools for my open-source projects. – Eduardo Bezerra Mar 04 '15 at 16:00
  • @EduardoBezerra: If you're hosting an OSS project, then I would recommend you go over my answer here: http://stackoverflow.com/questions/15876211/how-to-opensource-a-maven-plugin/15876923#15876923. You can get your project hosted on Sonatype's OSS Maven repository. – carlspring Mar 04 '15 at 16:06
  • Also, I'd like to depend on maven itself only, and not on a 3rd party tool. – Eduardo Bezerra Mar 04 '15 at 16:12

0 Answers0