-1

I'm converting an existing Eclipse-based web project to a Maven-managed one.

Since the project has lots of dependencies, many of which are custom (they're either internally made or they've been taken from sources that have no public repository), is there some 'magic' Maven POM setting that will let me load every jar from WebContent/WEB-INF/lib and make the project work as before right now, so that I can configure each dependency and do the necessary refactoring to turn it to a proper Maven project with a little more time and care?

I have already seen this question, but the project must continue to compile inside Eclipse, so - or at least I guess - it is not just a matter of using the Maven war plugin

Community
  • 1
  • 1
watery
  • 5,026
  • 9
  • 52
  • 92
  • 1
    This had been answered many times see: http://stackoverflow.com/questions/2449461/convert-existing-eclipse-project-to-maven-project As one example – bcar Sep 03 '14 at 14:27
  • @bcar Well, that was four years ago, I thought something had come up more recently. But it seems that it hadn't. As linked by [this answer](http://stackoverflow.com/a/11818558/3127111) all the dependencies must be configured manually. – watery Sep 03 '14 at 17:03

1 Answers1

0

What you want to do is called "installing" your non-mavenized JARs into your maven repository. This can be a local or remote repo that you host.

The command to install to your local repo is something like this: mvn install:install-file -Dfile=My-lib.jar -DgroupId=com.mycompany -DartifactId=My-lib -Dversion=1.2.3 -Dpackaging=jar

You'll want to review the various options for install to suit your project.

Once the non-mavenized dependencies are installed to your repo you can add them to your pom like any other maven dependency. They will be fetched from your local repo.

You will have to set up your own remote repo (like Artifactory) or install each plugin for every developer and CI server in your environment for others on your team to build the project. I strongly reccomend Artifactory, it makes it easy on your and your team to use maven and get dependencies.

Freiheit
  • 8,408
  • 6
  • 59
  • 101
  • Thanks for the tip about installing jars in my local repository, it will be useful when we'll have a central internal repo. For now, I just wanted to know if there's a simple way to have my project Maven managed without changing the existing jars location. But it's clear that it doesn't exist. – watery Sep 03 '14 at 16:59