Maven dependency timeout settings - maven

Maven reports timeout exception while downloading dependencies, as it's default time out is 60000, but in my case I need to increase because ( The environment where I am working has established an intermediary server that first download all the file to it's own server and my machine get those downloaded file from that intermediary server).
Now here the problem comes, if the dependency is too large simply that takes more than 60000 mili seconds then eclipse burst with the following exception
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Arquillian Persistence Extension Aggregator
[INFO] Arquillian Persistence Extension API
[INFO] Arquillian Persistence Extension SPI
[INFO] Arquillian Persistence Extension Core
[INFO] Arquillian Persistence Extension DBUnit Integration
[INFO] Arquillian Persistence Extension Integration Tests
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Arquillian Persistence Extension Aggregator 1.0.0.Final-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-java-version) # arquillian-persistence-parent ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven-version) # arquillian-persistence-parent ---
[INFO]
[INFO] --- maven-dependency-plugin:2.3:unpack (unpack) # arquillian-persistence-parent ---
[INFO] Configured Artifact: org.wildfly:wildfly-dist:8.0.0.Final:zip
Downloading: http://repo.maven.apache.org/maven2/org/wildfly/wildfly-dist/8.0.0.Final/wildfly-dist-8.0.0.Final.zip
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Arquillian Persistence Extension Aggregator ....... FAILURE [2:11.315s]
[INFO] Arquillian Persistence Extension API .............. SKIPPED
[INFO] Arquillian Persistence Extension SPI .............. SKIPPED
[INFO] Arquillian Persistence Extension Core ............. SKIPPED
[INFO] Arquillian Persistence Extension DBUnit Integration SKIPPED
[INFO] Arquillian Persistence Extension Integration Tests SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:11.908s
[INFO] Finished at: Wed May 07 11:27:41 PKT 2014
[INFO] Final Memory: 22M/177M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.3:unpack (unpack) on project arquillian-persistence-parent: Unable to resolve artifa
ct. Could not transfer artifact org.wildfly:wildfly-dist:zip:8.0.0.Final from/to central (http://repo.maven.apache.org/maven2): No response received after 60000
[ERROR] org.wildfly:wildfly-dist:zip:8.0.0.Final
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] central (http://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR] -> [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/MojoExecutionException
No response received after 60000 , this line creates trouble.
As a Solution :
I am using settings.xml with the following settings
<settings>
<servers>
<server>
<id>central</id>
<configuration>
<timeout>120000</timeout>
</configuration>
</server>
</servers>
</settings>
while I am sure the path of the settings.xml is correct.
Unfortunately it does not work.

According to this Maven guide there's a new way to set up timeouts.
I changed my ~/settings.xml that now reads like that...
<server>
<id>central</id>
<configuration>
<httpConfiguration>
<all>
<connectionTimeout>120000</connectionTimeout>
<readTimeout>120000</readTimeout>
</all>
</httpConfiguration>
</configuration>
</server>
It seems to work in my case. I tried with an unexisting repository and it seems to fail far quicker than before, when I set both timeouts to 5000. Can you give it a try ?

Related

spring boot maven plugin build-image is not working

I created demo project from start.spring.io with spring boot version 3.0.1 and java version 17.
I tried to execute below command on terminal to build Docker image
mvn spring-boot:build-image -Dspring-boot.build-image.imageName=testtesttest
It resulted in error
[INFO] [creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[INFO] [creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[INFO] [creator] Using Java version 18 extracted from MANIFEST.MF
[INFO] [creator] No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO] [creator] : Contributing to layer
[INFO] [creator] Warning: Dependency has no SHA256. Skipping cache.
[INFO] [creator] Downloading from
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to get dependency
[INFO] [creator] unable to download
[INFO] [creator] unable to request
[INFO] [creator] Get "": unsupported protocol scheme ""
[INFO] [creator] ERROR: failed to build: exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.756 s
[INFO] Finished at: 2023-01-02T15:18:19+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.1:build-image (default-cli) on project demo: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.0.1:build-image failed: Builder lifecycle 'creator' failed with status code 51 -> [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/PluginExecutionException
I am using openjdk (version "18.0.2" 2022-07-19) on mac. Not able to figure it out. Can you please help.
Looks like the default image builder doesn't yet support Mac M1 processor. I had to add an alternative builder for maven plugin in my pom.xml as shown below:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>dashaun/builder:tiny</builder>
</image>
</configuration>
</plugin>

Mvn project plugins not found.

Bought the Spring Data book and try to "mvn install" the sample code on STS and have the following:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
// This is the Maven output
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Spring Data Book
[INFO] Spring Data Book - JPA
[INFO] Spring Data Book - MongoDB
[INFO] Spring Data Book - Querydsl
[INFO] Spring Data Book - Neo4J
[INFO] Spring Data Book - JDBC
[INFO] Spring Data Book - Redis
[INFO] Spring Data Book - GemFire
[INFO] Spring Data Book - REST exporter
[INFO]
[INFO]
[INFO] Building Spring Data Book 1.0.0.BUILD-SNAPSHOT
[INFO]
[INFO] Installing C:\spring-data-book\pom.xml to C:\Users\A27L4PT\.m2\repository\com\oreilly\springdata\spring-data-book\1.0.0.BUILD-SNAPSHOT\spring-data-book-1.0.0.BUILD-SNAPSHOT.pom
[INFO]
[INFO]
[INFO] Building Spring Data Book - JPA 1.0.0.BUILD-SNAPSHOT
[INFO
[WARNING] The POM for org.apache.maven.plugins:maven-surefire-plugin:jar:2.1.6 is missing, no dependency information available
[INFO]
[INFO] Reactor Summary:
[INFO]
[INFO] Spring Data Book .................................. SUCCESS [3.292s]
[INFO] Spring Data Book - JPA ............................ FAILURE [0.074s]
[INFO] Spring Data Book - MongoDB ........................ SKIPPED
[INFO] Spring Data Book - Querydsl ....................... SKIPPED
[INFO] Spring Data Book - Neo4J .......................... SKIPPED
[INFO] Spring Data Book - JDBC ........................... SKIPPED
[INFO] Spring Data Book - Redis .......................... SKIPPED
[INFO] Spring Data Book - GemFire ........................ SKIPPED
[INFO] Spring Data Book - REST exporter .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.592s
[INFO] Finished at: Mon Feb 17 11:34:55 EST 2014
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.1.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.1.6: Failure to find org.apache.maven.plugins:maven-surefire-plugin:pom:2.1.6 in http://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 -> [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]
Add surefire to your depencies.
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
</dependency>
This version might be wrong. Did not find 2.1.6 on http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin
Apparently there is a typo in one of the source files. Search all pom.xml files for "2.16" and after verifying that you are dealing with the surefire plugin version, change that to "2.1.6", which is the latest valid version as of today.
If you can't find any reference to this version in the pom files, then add a plugin management section to the root pom.xml:
<build>
...
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.1.6</version>
</plugin>
</plugins>
</pluginManagement>
...
</build>

java project not getting analysed in sonar 3.3.5

When I give mvn sonar:sonar for sample java project in sonar I get this error.The sample project is from link
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Simple Java Maven Project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.0:sonar (default-cli) # example-java-maven ---
[INFO] Sonar version: 3.5.1
[INFO] [12:29:59.781] Load batch settings
[INFO] [12:30:00.000] User cache: C:\Documents and Settings\xxx\.sonar\cache
[INFO] [12:30:00.156] Install plugins
INFO] [12:30:03.250] ------------- Executing Project Scan
[INFO] [12:30:04.500] Install JDBC driver
INFO] [12:30:04.515] Apply project exclusions
[WARN] [12:30:04.531] H2 database should be used for evaluation purpose only
[INFO] [12:30:04.531] Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
[INFO] [12:30:04.890] Initializing Hibernate
[INFO] [12:30:09.500] ------------- Inspecting Simple Java Maven Project
[INFO] [12:30:09.515] Load module settings
[INFO] [12:30:09.937] Excluded tests:
[INFO] [12:30:09.937] **/package-info.java
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.125s
[INFO] Finished at: Thu Jun 13 12:30:11 IST 2013
[INFO] Final Memory: 9M/28M
[INFO] ------------------------------------------------------------------------
ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d
efault-cli) on project example-java-maven: Can not execute Sonar: You must insta
ll a plugin that supports the language 'java' -> [Help 1]
ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
Should I manually put any plugin to analyze java project?
It looks like you have removed the Java plugins from your Sonar home directory. You can upload the latest version at http://docs.codehaus.org/display/SONAR/Java+Ecosystem, copy the plugins into SONAR_HOME/extensions/plugins and restart your Sonar server.

Weblogic Maven Deploy

I am using weblogic 10.3.6.0 and maven 3. I want to deploy my project to weblogic server with maven plugin. I do same steps in this oracle documents
But when I build my project, I get this error
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building JBoss Portlet Bridge - JSF 2 Basic Portlet 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:2.9.5:deploy (default-cli) # TestWeblogic ---
[WARNING] The POM for weblogic:weblogic:jar:10.3.6 is missing, no dependency i information available
[WARNING] The POM for weblogic:webservices:jar:10.3.6 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.446s
[INFO] Finished at: Mon Jul 01 16:50:02 EEST 2013
[INFO] Final Memory: 7M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:weblogic-maven-plugin:2.9.5:deploy ( (default-cli) on project TestWeblogic: Execution default-cli of goal org.codehaus.mojo:weblogic-maven-plugin:2.9.5:deploy failed: Plugin org.codehaus.mojo:weblogic-maven-plugin:2.9.5 or one of its dependencies could not be resolved: The following artifacts could not be resolved: weblogic:weblogic:jar:10.3.6, weblogic:webservices:jar:10.3.6: Failure to find weblogic:weblogic:jar:10.3.6 in http://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 -> [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/PluginResolutionException
My pom xml is here
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>10.3.6.0</version>
<configuration>
<adminurl>t3://localhost:7001</adminurl>
<user>username</user>
<password>password</password>
<upload>true</upload>
<action>deploy</action>
<remote>false</remote>
<verbose>true</verbose>
<source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
<name>${project.build.finalName}</name>
</configuration>
</plugin>
I use weblogic server 10.3.6.0, eclipse juno , maven 3.0.4.
You need to import wlfullclient.jar and webservices.jar. I tried importing the weblogic.jar first, but maven threw a ClassCastException by weblogic.utils.Debug.
To build this client you need to execute: java -jar wljarbuilder.jar inside the WL_HOME/server/lib.
Once you are ready, import into the maven repository by executing the following commands:
mvn install:install-file -DgroupId=weblogic -DartifactId=weblogic
-Dversion=10.3.6 -Dpackaging=jar -Dfile=wlfullclient.jar
mvn install:install-file -DgroupId=weblogic -DartifactId=webservices -Dversion=10.3.6 -Dpackaging=jar -Dfile=webservices.jar
Looks like you are using JBoss, not Weblogic based on your logs:
Building JBoss Portlet Bridge

org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2 error

I have the following Maven project structure:
xyz
|
-props
| |
| - root.properties
|
-module_a
| |
| -pom.xml
|
-pom.xml
My root artifact defines a child module (module_a) and this is referencing the parent artifact.
In the root pom.xml I am reading a property file from the common props folder using the
org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2 plugin.
When I issue the
mvn clean package
command I get the following putput:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] my_artifact
[INFO] module_a
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my_artifact 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # my_artifact ---
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (default) # my_artifact ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building module_a 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # module_a ---
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (default) # module_a ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] my_artifact ....................................... SUCCESS [0.234s]
[INFO] module_a .......................................... FAILURE [0.000s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.344s
[INFO] Finished at: Thu Aug 09 15:37:46 CEST 2012
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default) on project module_a: Properties file not found: G:\java\xyz\module_a\props\root.properties -> [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/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :module_a
In the child module Maven tries to read the property file from an inexistetnt subfolder. Can anybody help me solve this?
Thank you
When maven evaluates the pom files and creates the effective poms ( aggregated with inheritance) some properties are excluded from being inherited. These are the ones starting with project.* and therefore also the project.basedir. Thats why you cannot define the property from where the property file is being loaded in the parent.
The reason for this behaviour is isolation. Every module should be isolated from everything but the maven repository. Even using the settings.xml profiles violates this invariant and you loose the portability of builds.
This invariant is not necessary in many cases so if you have many modules and you want to use one property file, what you can do is:
define a property e.g. "filters.dir" in your root pom to ${project.basedir}/src/main/filters
configure the plugin to load a property file from ${filters.dir}/my.properties
in any submodule you can now override filters.dir to ../src/main/filters
if you have many submodules you can define a wrong path "../src/main/filters" for filters.dir in the root and then you don't need to define the property in any submodule. To prevent the build from failing you need to set the plugin to ignore failures.
An alternative would be to write a maven extension by extending AbstractMavenLifecycleParticipant and load the property file there using the maven api to determine the root directory of your project.
I have face a similar issue.
I have a parent project pom.xml which has a build.properties file
the parent project has several modules.
When I created a new module, and wanted to build the whole parent project, I got:
[ERROR] Failed to execute goal org.codehaus.mojo:properties-maven-plugin:1.0-alpha-2:read-project-properties (default) on project attachment-services: Properties file not found: /home/raz/git/parent/attachment-services/build.properties -> [Help 1]
To fix this, I have added in the new module's pom.xml the following
<properties>
<build.properties.location>..</build.properties.location>
</properties>
and of course, this build.properties.location was already defined in the parent pom, like:
<properties>
<build.properties.location>${project.basedir</build.properties.location
</properties>

Resources