2

I don't understand following error I am getting while executing : mvn install

I have the javax.transaction:jta:jar:1.0.1B artifact in my m2 repository and I did make sure that the maven is looking at the right repository (By running mvn -X) Has anybody ever experienced and resolved this kind of error.

Failure to find javax.transaction:jta:jar:1.0.1B in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

MLS
  • 617
  • 1
  • 7
  • 14
jay26
  • 49
  • 2
  • 8
  • That error is telling you that you have a local entry in your repository that is not found in the maven repository. I think you could live with the error - but shouldn't you update your dependency to the version that _is_ on the Maven repo? – moilejter Aug 14 '18 at 23:06
  • Is there a way to disable/pass this error. Because of this error the build stops. – jay26 Aug 18 '18 at 18:08

3 Answers3

1

I had this same problem. The jar was installed in my local .m2 directory.

  • I had the pom.xml updated with the dependency element for the jar file.
  • I even added the localRepository element in a local settings.xml (even though this is the default and shouldn't be needed).
  • The authorities on the directories was what is required: drwxr-xr-x on directories and -rw-r--r-- on the files in the respository
  • none of the other items in the list from the DependencyResolutionException were helpful

I decided to try running with sudo on the mvn install and this made the difference (I am on a mac if that matters): sudo mvn install:install-file -DgroupId=com.nav.abc - DartifactId=xy.abc -Dversion=1.0.0 -Dpackaging=jar - Dfile=abcAdapter/xy.abc.jar

And now it seems to be working! I don't see any difference in the access authorities on the directories so I'm not sure how this made any difference... but it does work

lrpowell
  • 41
  • 6
  • It seems that the folder structure that maven creates takes some configuration that may be specific to your environment at that time. When I run your command, some files in that filegroup had changes in content. For exemple, the old -remote.repositories had an attribute like this "locator-1.0.0.pom>=". In the new -remote.repositories, this attribute is like this: "locator-1.0.0.pom>nexus=". – Fabian Brandão Mar 08 '21 at 21:29
0

Since you say the jar is in your local .m2, it is strange that Maven still goes to the central repo to find it, ideally it should not. I am thinking it might be related to a different dependency, for example like in this thread. Could you check if yours if the same scenario?

The other thing you could do is look for a repository where this version of JTA exists and add that repository to your settings.xml or pom.xml, however you have that configured. One another option is you could try with a different version of JTA jar and see if you run in to the same issue.

ranjithkr
  • 594
  • 3
  • 10
0

Go to the folder contains javax.transaction:jta:jar:1.0.1B in your .m2 and then delete this file _remote.repositories

jackson
  • 41
  • 4