Maven dependencies are not downloading - spring

Error image (https://i.stack.imgur.com/gjVYG.png)](https://i.stack.imgur.com/gjVYG.png)
I tried to add manually jar files and did everything but I'm unable to solve the issue.

Related

How to skip download jar when open maven project in IDEA?

Sometimes I just want to see a small piece of code in a maven project. Every time I open a maven project, I need to download the jar defined in pom.xml. I can't see the source code without downloading it. What should I do?

JNI Error followed by Java Error when opening exectuable-jar

Good evening,
I encountered a problem while building an executable jar with Intellij. Before I never encountered Problems with it, but this time there is JNI Error occured and a Java Error occured message. I already tried the tips I found in Stackoverflow. It won't work with Maven Assembly Plugin or Maven Dependency Plugin. Moreover I tried creating the MANIFEST in main/java and main/resources. When I create it in main/java nothing happens when i open the jar with the second method the error mentioned earlier occures.
The only way it works is using this option in Artifacts
But using this option all of the libraries are in the file Path individually and the jar size is 75 kb. My goal was to create ONE fat executable jar. Btw another maven project I created works finde after creating the jar. Thanks in advance.

Maven - unable to download dependencies behind Proxy Error Code - 307 Temporary Redirect

I am using Maven to run a Java project. My issue is that I am not able to download the dependencies. It is giving the following error
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.7.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.7.1: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2): Failed to transfer http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.7.1/maven-surefire-plugin-2.7.1.pom. Error code 307, Temporary Redirect -> [Help 1]
The settings.xml is properly configured with the proxy details (since I am behind a proxy) Still, I am not able to access the maven repo to download.
UPDATE: Thanks a lot landal79.I revisited this issue after some time. Still this issue gives me a nightmare.
Currently, I am not able to create any Maven Project. I am 100% sure this is due to a proxy issue. But not able to
nail it down to where exactly the issue.
When I try creating a project selecting an archetype, I am not able to create a maven project. I am getting the below error
"Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-
quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users\rrr.m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users\rrr.m2\repository)"
I try creating this project through Eclipse. The settings.xml point to the right proxy ( cross checked with the Network connections dialog (window ->General->NetworkConenction Dialog). But the issue still persists.
So what I did was installed standalone Maven and create a maven project from command prompt. To my surprise,I am not able to download the archetypes in Maven Repo though other plugins are getting downloaded (Surefire plugin and JUNit jar for example)
Is there any work around to resolve the archetype download issue?
I tried your solution, but the issue still persists. When I create a simple maven project (without using any archetypes) I am getting "Unable to build Project " Error
PS: The proxy settings are defined in settings.xml and they are correct. Also, the eclipse proxy settings are correct (Since I am able to install plugins from Eclipse MarketPlace)
Eclipse experts - please help me resolve this issue. Thanks a lot in advance for help.
Thanks

Intellij trying to treat pom.xml as jar file

While trying to run test (on a maven project) from Intellij , I am constantly getting below mentioned error
[my-module] Exception in parsing jar file for extract from jar: /path/to/pom.xml java.util.zip.ZipException: The JAR/ZIP file (/path/to/pom.xml) seems corrupted, error: error in opening zip file
However all maven cycles run well when run from the command line.
Has anyone faced this issue before ?
I have already tried all these things
Invalidated Intellij Idea
Deleted my .m2 repo and recreated the project
ok , finally fixed.The osgi facets apparently were responsible.The issue was resolved once the facet was removed.Do not know the exact reason but the intellij osgi facet is known to be unstable. More info here
Even in 2020 this IntelliJ (Ultimate 2019.2) plugin tries to open a pom.xml file as a jar file. Disabling the OSGI plugin helped in my case:

maven build failure: cannot read zip file entry

i am getting this exception when try to run as-> maven build
.m2\repository\commons-logging\commons-logging\1.1\commons-logging-1.1.jar; cannot read zip file entry
I've already spent a day on it , searched over google , but no luck
any idea how can i resolve this
thanks
Try to open the jar with a Zip utility (7Zip ou something else).
If it fails, delete the file from your local repository, and retry to run your app.
If it fails again, then you may have an issue with your Maven repos config.
If maven downloads corrupt jars (jars that do not open with a zip utility) - try downloading those perticular jars manually and replace them in the appropriate repository folder location.
In settings.xml specify the localRepository path explicitly. Using the default settings (i.e. not specifing localRepository) causes maven to download the jars again and again when you do a "clean install" and you end up have the corrupt jars again.
In my experience, it is caused by a corrupted zip file. A failed build often appends to the jar, but doesn't delete it, therefore producing an unreadable file.
The solution, as suggested, is to delete the jar, then try to download again from the repository (create a maven build with package goal) If that repeatedly fails, the remote location might be corrupted.
Delete the m2 repository folder and try running your maven ,it will download all the jar files again and the build success

Resources