[JAVA] What to do when a Missing artifact occurs in a jar that is not defined in pom.xml

--Environment - CentOS Linux release 7.6.1810 (Core) - Apache Maven 3.2.5 -(For Maven) Java1.8.0_242 (For project) Java1.6.0_41

Event: I got angry when I selected a project in Eclipse> [Maven]> [Update Project ...]

[Problems]Tab error


Missing artifact javax.resource:connector:jar:1.0
Missing artifact javax.transaction:jta:jar:1.0.1B

Even if you grep the pom.xml of the project, there is no such definition ...

$ grep -rn connector --include=pom.xml
$ grep -rn jta --include=pom.xml
$

Cause: pom.xml There is no jar that depends on the defined jar

trial and error

Open the project's pom.xml in Eclipse> Open the Dependency Hierarchy tab> Search for the jar name in Filter "I found it!" It was a jar that had a dependency on jotm ...

image.png If you check jotm in pom.xml and search with Maven Repository: Search / Browse / Explore, it will be fine ...

pom.xml


...abridgement...
<dependency>
  <groupId>jotm</groupId>
  <artifactId>jotm</artifactId>
  <version>2.0.10</version>
  <scope>provided</scope>
  <exclusions>
...abridgement...

image.png

Check the pom of jotm

$ cat ~/.m2/repository/jotm/jotm/2.0.10/jotm-2.0.10.pom
...abridgement...
    <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>jta</artifactId>
      <version>1.0.1B</version>
    </dependency>
...abridgement...
    <dependency>
      <groupId>javax.resource</groupId>
      <artifactId>connector</artifactId>
      <version>1.0</version>
    </dependency>

Searching with Maven Repository: Search / Browse / Explore For a while, I thought "Aruyan!", And when I pressed the [jar] link, I got a 404 Not Found ... Both of the jars in error were in the same state.

image.png image.png

Action 1: change the version of jar defined in pom.xml

If you search the jotm defined in pom.xml again with Maven Repository: Search / Browse / Explore It was Note: This artifact was moved to: org.ow2.jotm» jotm. image.png

I followed the link and decided to use the oldest version of 2.1.1 in ʻorg.ow2.jotm »jotm`.

Pom after change.xml


...abridgement...
    <dependency>
      <groupId>org.ow2.jotm</groupId>
      <artifactId>jotm</artifactId>
      <version>2.1.1</version>
      <type>pom</type>
      <exclusions>
...abridgement...

Solution 2: Install the jar that is dependent on the jar with Maven

Reference: How to specify a library that is not in the Maven repository in pom.xml --grep Tips How to say "The version cannot be changed!" Of jotm

  1. Get the jar that became Missing artifact ――I'll do my best to get it from the ~ / .m2 / repository directory in someone's environment or somewhere on the Internet.
  2. Store the jar around the project's WEB-INF / lib / directory so you don't lose it
  3. Install with Maven --Check the optional -DgroupId``-DartifactId -Dversion with the pom of jotm
  4. [Maven]> [Update Project ...] in Eclipse
#Go to the jar location
$ cd path/to/WEB-INF/lib/

#Install jar with Maven
$ mvn install:install-file -Dfile=jta-1.0.1B.jar -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar
[INFO] Scanning for projects...
...abridgement...

$ mvn install:install-file -Dfile=connector-1.0.jar -DgroupId=javax.resource -DartifactId=connector -Dversion=1.0 -Dpackaging=jar
[INFO] Scanning for projects...
...abridgement...

#Then maven with jar-metadata-local.xml is created
$ find ~/.m2/repository/javax/ -iname *.xml
/home/ponsuke/.m2/repository/javax/resource/connector/maven-metadata-local.xml
/home/ponsuke/.m2/repository/javax/transaction/jta/maven-metadata-local.xml

Recommended Posts

What to do when a Missing artifact occurs in a jar that is not defined in pom.xml
What to do when a warning message is displayed in pip list
NameError: global name'dot_parser' is not defined and what to do when it comes up in python
What to do if a UnicodeDecodeError occurs in pip
[Python] Type Error:'WebElement' object is not iterable What to do when an error occurs
What to do when is not in the sudoers file.This incident will be reported.
What to do when a Remove Error occurs when updating conda
What to do if a 0xC0000005 error occurs in tf.train.start_queue_runners ()
What to do when UnicodeDecodeError occurs during read_csv in pandas (pd.read_table ())
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
What to do when the value type is ambiguous in Python?
What to do if there is a decimal in python json .dumps
What to do when the result downloaded via scrapy is in English
What to do when the warning "The environment is in consistent ..." appears in the Anaconda environment
[OSX] [pyenv] What to do when an SSL error occurs in pip
What to do in my case when pyenv install is not possible after upgrading to macOS Big Sur
What to do when PermissionError of tempfile.mkstemp occurs
What to do if CERTIFICATE_VERIFY_FAILED occurs when nltk.download () is done on macOS pyhon
[python] What to do when an error occurs in send_keys of headless chrome
What to do when a warning appears around Python integration in Neovim's CheckHealth
What to do if a Unicode Encode Error occurs in Sublime Text Python
What to do when "TypeError: data type not understood" appears in python's numpy.zeros
What to do if abort is displayed when inputting camera video in OpenCV
What to do when the graph does not appear in jupyter (ipython) notebook
What to do if NotADirectoryError: [Errno 20] Not a directory:'xdg-settings' appears in jupyter notebook
What to do if a version error occurs in the selenium Chrome driver
[EC2] What to do when selenium is stuck and processing does not proceed
What to do if you get the error RuntimeError: Python is not installed as a framework when trying to use matplitlib and pylab in Python 3.3
curl: (60) What to do when Issuer certificate is invalid.
What to do when gdal_merge creates a huge file
What to do if pyenv is not enabled (zsh)
How to use a library that is not originally included in Google App Engine
What to do when only the window is displayed and nothing is displayed in pygame Note
What to do if the progress bar is not displayed in tqdm of python
What to do if Python IntelliSense is not displayed in VS Code on Windows
What to do when Python starts up in Anaconda does not come out unexpectedly
What to do when PyCharm font is strange or garbled
What to do when there is no response due to Proxy setting in Python web scraping
What to do if the image is not displayed using matplotlib etc. in the Docker container
What to do when an error occurs with import _ssl
What to do when "SSL: CERTIFICATE_VERIFY_FAILED _ssl.c: 1056" appears in Python
What to do when "Invalid HTTP_HOST header" appears in Django
What to do if ʻObject arrays cannot be loaded when allow_pickle = False` occurs in numpy.load ()
[Beginner] What to do when "[Errno 2] File b'test.csv' does not exist: b'test.csv" is displayed when reading pandas csv
[virtualbox] What to do when [Could not retrieve mirrorlist] appears when yum update is performed on CentOS7
What to do when a part of the background image becomes transparent when the transparent image is combined with Pillow
What to do if you get a must override `get_config` error when trying to model.save in Keras
[AWS] What to do when the ping command causes a "timeout"
What to do if you get a minus zero in Python
[Beanstalk] What to do when an error occurs with import uuid
What to do when the jupyterlab extension settings are not reflected
What to do if "Unnamed: 0" is added in to_csv-> read_csv in pandas
What to do when Ubuntu crashes
A story about what to do when a bad interpreter: Not such file or directory appears in Anaconda3 and how to investigate the cause.
[Python] What to do when PEP8 is violated in the process of importing from the directory added to sys.path
How to write what to do when an application is first displayed in Qt for Python with Designer
[Python] What to do if you get a ModuleNotFoundError when importing pandas using Jupyter Notebook in Anaconda
What to do if a symbolic link error occurs in import cv while trying to install OpenCV in Python
What to do when you get angry that libxml / xmlversion.h does not exist when you put lxml with pip
[Memorandum] What to do when a warning appears after executing pip list
[Python] What to do when an error related to SSL authentication is returned