2

I am converting a 10+ years old java project to Maven project.

First I mapped all the publicy available libraries and created a POM. I then converted my local copy of the project to Maven and added the dependecies to the POM. Made some adjustments related to maven compiler target, paths and fixes to minor issues that popped-up.

Now there are 13 libraries that are either proprietary or no one in the company knows their source and they are required.

So, we have a bitbucket account and create a repository to store all these libraries on bitbucket. First we create a local repo on a different computer using:

mvn install:install-file -Dfile=./Sigep.jar -DgroupId=br.com.unoerp -DartifactId=sigep -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true

Then we have uploaded this repository to bitbucket.

I have then added the dependencies to the project pom based on the mvn install information used:

    <dependency>
        <groupId>br.com.unoerp</groupId>
        <artifactId>sigep</artifactId>
        <version>1.0</version>
    </dependency>

I also created the repository tags pointing to our repository:

    <repository>
        <id>uno-repository</id>
        <name>Uno Repository</name>
        <url>https://bitbucket.org/my_repository/maven-repository/raw/master/</url>
    </repository>

When I ran Maven>Update Project, I got on Eclipse log:

Missing artifact br.com.unoerp:sigep:jar:1.0

The same for all the other 11 libraries.

I decided to have a look on my local repo, and the structure created is ok, but all the files inside of it have as file extension lastUpdated, which are actually log files with no real useful information (at least not for me). Also, I can find POM, Javadoc and source files ending with the lastUpdated extension which do not actuaaly exists.

I have tried several other thing based on Google searchs, some are: * On the POM, added tag pointing to my repo bitbucket link * Added tags with adding wagon-get artifact * from the console, run mvn compile and mvn -U compile

Any ideas on what I am missing or doing wrong?

Estevao Santiago
  • 793
  • 2
  • 7
  • 30
  • check your settings eclipse > preferences > maven > user settings – Gnk Sep 20 '18 at 17:40
  • What exactly should I check for? – Estevao Santiago Sep 20 '18 at 17:45
  • check if your repository folder on eclipse is the same where you installed Sigep.jar – Gnk Sep 20 '18 at 17:52
  • Yes it is. As mentioned, files are created in the local repo, but they are not the jars, they are logs. – Estevao Santiago Sep 20 '18 at 18:44
  • when you run install-file you console show BUILD SUCCESS? – Gnk Sep 20 '18 at 18:53
  • You are missing the information I wrote in the question. The mvn install-file was not run on this computer. The command was run on a different PC in order to create the repository structure which, was successfull, and then the whole repository was uploaded to bitbucket, as we are going to use it as a remote repository to download these 13 libraries. The problem is that maven seems unable to donwload the files from the remote repo for some reason. I need this process to work, because we have remote devs which will consume this service. – Estevao Santiago Sep 20 '18 at 20:25

1 Answers1

0

If anyone finds this because of the same issue, the problem was due to the url tag. I was missing "/repositoy" from it. The correct entry for the reposuoty is as follow:

<repository>
    <id>uno-repository</id>
    <name>Uno Repository</name>
    <url>https://bitbucket.org/my_repository/maven-repository/raw/master/repository</url>
</repository>
Estevao Santiago
  • 793
  • 2
  • 7
  • 30