Unable to compile POM.xml file after adding POI or Log4j dependency | Selenium Forum
A
Ashish Posted on 17/02/2020

Gettting error when i am trying to compile pom.xml file after adding log4j or POI api dependency. [Working file if i add selenium or any other depenedecy]

 

failing at - [INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/poi/poi/3.16/poi-3.16.pom

Ideally its checking for "http://repo.maven.apache.org/maven2/org/apache/poi/poi/3.16/poi-3.16.pom" but actual files are at HTTPS.

Actual file are at " https://repo.maven.apache.org/maven2/org/apache/poi/poi/3.16/poi-3.16.pom"

 

how can i tell maven to look for HTTPS ?? That looks to be the issue here. 

Getting error as: 

[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building POM_utube 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/poi/poi/3.16/poi-3.16.pom
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/poi/poi-ooxml/3.17/poi-ooxml-3.17.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.687 s
[INFO] Finished at: 2020-02-16T23:48:59-06:00
[INFO] Final Memory: 9M/230M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project POM_utube: Could not resolve dependencies for project Framework:POM_utube:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.apache.poi:poi:jar:3.16: Failed to read artifact descriptor for org.apache.poi:poi:jar:3.16: Could not transfer artifact org.apache.poi:poi:pom:3.16 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer http://repo.maven.apache.org/maven2/org/apache/poi/poi/3.16/poi-3.16.pom. Error code 501, HTTPS Required -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException


A
Ashish Thakur Replied on 18/02/2020

POI needs a few other dependencies to be specified as well. Please refer to poi.apache.org for references.


A
Ashish Replied on 18/02/2020

You didnt follow my question completely.. It is not related to POI.. 

If i add only Log4J jars even then i am getting above error.. Looks like something changed at Maven end and its looking for file in HTTP but maven files are at HTTPS.. hence getting above error. 

 

It is failing here: Files are present at HTTPS - httpS://repo.maven.apache.org/maven2

[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/logging/log4j/log4j-api/2.13.0/log4j-api-2.13.0.pom
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/logging/log4j/log4j-core/2.13.0/log4j-core-2.13.0.pom


A
Ashish Thakur Replied on 18/02/2020

Please read your query clearly below

Gettting error when i am trying to compile pom.xml file after adding log4j or POI api dependency. [Working file if i add selenium or any other depenedecy]

 

failing at - [INFO] Downloading: http://repo.maven.apache.org/maven2/org/apache/poi/poi/3.16/poi-3.16.pom

Ideally its checking for "http://repo.maven.apache.org/maven2/org/apache/poi/poi/3.16/poi-3.16.pom" but actual files are at HTTPS.

Actual file are at " https://repo.maven.apache.org/maven2/org/apache/poi/poi/3.16/poi-3.16.pom"

 

Anyways, try updating the maven to the latest version.

Also, I need to know the version of the JDK you are using.


A
Ashish Replied on 18/02/2020

my jdk version is 1.8.. 

 


A
Ashish Thakur Replied on 19/02/2020

Is the issue resolved?


A
Ashish Replied on 26/02/2020

Yes... its resolved.. Looks like maven did some changes on Jan 15 after that it created problem.. 

 

To fix i added below tag in my POM.XML:

 

<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>


Related Posts