spring boot maven plugin build-image is not working - spring-boot

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>

Related

Applying a patch at runtime in Maven

I'm trying to install Giraph 1.1 but ran into an issue. According to this thread I should apply a patch to my installation. Unfortunately, my problem stems from that. I downloaded and copied the .patch file linked in there to the source folder and added the following to the pom.xml:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-patch-plugin</artifactId>
<version>1.2</version>
<configuration>
<patches>
<patch>GIRAPH-1110.02.patch</patch>
</patches>
...
</plugins>
Unfortunately when I run Maven with:
sudo mvn -Phadoop_yarn -Dhadoop.version=2.8.1 clean package -DskipTests
it still fails with the same error as it did before:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /usr/local/giraph/giraph-core/target/munged/main/org/apache/giraph/job/GiraphJob.java:[213,11] setPingInterval(org.apache.hadoop.conf.Configuration,int) is not public in org.apache.hadoop.ipc.Client; cannot be accessed from outside package
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Giraph Parent ............................... SUCCESS [ 6.298 s]
[INFO] Apache Giraph Core ................................. FAILURE [ 9.359 s]
[INFO] Apache Giraph Examples ............................. SKIPPED
[INFO] Apache Giraph Distribution ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.062 s
[INFO] Finished at: 2018-02-06T22:53:00+02:00
[INFO] Final Memory: 51M/640M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project giraph-core: Compilation failure
[ERROR] /usr/local/giraph/giraph-core/target/munged/main/org/apache/giraph/job/GiraphJob.java:[213,11] setPingInterval(org.apache.hadoop.conf.Configuration,int) is not public in org.apache.hadoop.ipc.Client; cannot be accessed from outside package
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
which clearly shows that the issue has not been patched. When I check the file manually, I can confirm that there's no change. If I change the file manually before compilation, the changes get discarded (I'm guessing the file gets redownloaded). Also can't run the installation with offline flag since it depends on downloading some dependencies. I'm at my wits end here.
My Maven version is 3.3.9.

Building SonarQube with maven and batch_boostrap/index cannot be found

I'm running mvn sonar:sonar in the directory of the project I'm running. I already have my pom.xml updated:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.7.1</version>
</plugin>
After running sudo mvn sonar:sonar (I am on ubuntu 14.04) in my terminal, I get the following error:
eschwartz#LATITUDE:~/ideaprojects/xQueryEngine$ sudo mvn sonar:sonar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building xQueryEngine (Solr 4 REX) 1.11.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.7.1:sonar (default-cli) # xqe ---
[INFO] User cache: /root/.sonar/cache
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.854s
[INFO] Finished at: Wed Feb 17 15:56:59 EST 2016
[INFO] Final Memory: 17M/302M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project xqe: Fail to download libraries from server: Status returned by url : 'http://localhost:9000/batch_bootstrap/index' is invalid : 404 -> [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
Anyone know how to fix this?
Thanks.
You have to set sonar.host.url=http://localhost:9000/sonar. You can do this by passing -Dsonar.host.url=... to mvn, or ideally set it in your Maven Global/Project Settings so that you don't always have to pass it as a command line argument.
Details: if your dashboard is at localhost:9000/sonar then it means you're using sonar.web.context=/sonar , which is different from the default (/). So you need to tell the scanner where to find SonarQube.

Sakai 10 clog not compiling :(

I'm having a little trouble on compiling the clog tool for sakai 10...
https://github.com/adrianfish/clog/issues/5
I suspect adrian is busy on the 11 build at the moment, but I'm wondering if it's actually something that can be fixed by the user, or maybe others have hit this and are doing something simple that I don't know about..?
Basically the current stable version of clog (0.9.3 -https://confluence.sakaiproject.org/display/CLOG/Home) doesn't compile for the sakai 10 code base, there is what looks to be a related issue (CLOG-113) here...
https://github.com/adrianfish/clog/pull/3
but I'm not sure if the sakai-10 repository for maven exists as the error you get for compiling the sakai-10 branch of clog (https://github.com/adrianfish/clog/tree/sakai-10) is as follows:
bash-3.2$ mvn clean install
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.sakaiproject.clog:clog:0.9.5-SNAPSHOT (/usr/local/sakai/sakai-src-10.0/clog-0.9.5-sakai-10branch/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact org.sakaiproject:master:pom:10.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM # line 12, column 13 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
Has anyone managed to get clog to compile on sakai 10? This is a bit of a blocker for our sakai 10 deployment :(
Edit: (Also see "further edit" for solution)
After trying the suggestion (https://stackoverflow.com/a/24769111/3737856) below I get this error
*---snip---*
Downloaded: http://repo1.maven.org/maven2/org/apache/commons/commons-parent/17/commons-parent-17.pom (31 KB at 507.6 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom
Downloaded: http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom (15 KB at 320.3 KB/sec)
Downloading: http://repo1.maven.org/maven2/org/projectlombok/lombok/0.11.6/lombok-0.11.6.pom
Downloaded: http://repo1.maven.org/maven2/org/projectlombok/lombok/0.11.6/lombok-0.11.6.pom (2 KB at 34.0 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] CLOG .............................................. SUCCESS [ 7.693 s]
[INFO] CLOG API .......................................... FAILURE [ 3.520 s]
[INFO] CLOG IMPL ......................................... SKIPPED
[INFO] CLOG PACK ......................................... SKIPPED
[INFO] CLOG HELP ......................................... SKIPPED
[INFO] CLOG TOOL ......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.166 s
[INFO] Finished at: 2014-07-16T10:11:38+00:00
[INFO] Final Memory: 10M/59M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project clog-api: Could not resolve dependencies for project org.sakaiproject.clog:clog-api:jar:0.9.5-SNAPSHOT: Failed to collect depend encies at org.sakaiproject.kernel:sakai-kernel-api:jar:10.0: Failed to read artifact descriptor for org.sakaiproject.kernel:sakai-kernel-api:jar:10.0: Could not find arti fact org.sakaiproject:kernel:pom:10.0 in central (http://repo1.maven.org/maven2) -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :clog-api
I have built the current sakai 10 release build from source (building the master directory then the root), placed the clog source in the root and built it there. This usually works.
In addition I also tried changing in the clog pom:
<name>CLOG</name>
<groupId>org.sakaiproject.clog</groupId>
<artifactId>clog</artifactId>
<version>0.9.5-SNAPSHOT</version>
<packaging>pom</packaging>
to:
<name>CLOG</name>
<groupId>org.sakaiproject.clog</groupId>
<artifactId>clog</artifactId>
<version>0.9.5</version>
<packaging>pom</packaging>
building with this and the other suggested change resulted in this error:
-bash-3.2$ mvn clean install
[INFO] Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/sakaiproject/master/10.0/master-10.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/sakaiproject/master/10.0/master-10.0.pom (59 KB at 172.0 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] CLOG API
[INFO] CLOG IMPL
[INFO] CLOG PACK
[INFO] CLOG HELP
[INFO] CLOG TOOL
[INFO] CLOG
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CLOG API 0.9.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] CLOG API .......................................... FAILURE [ 1.374 s]
[INFO] CLOG IMPL ......................................... SKIPPED
[INFO] CLOG PACK ......................................... SKIPPED
[INFO] CLOG HELP ......................................... SKIPPED
[INFO] CLOG TOOL ......................................... SKIPPED
[INFO] CLOG .............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.584 s
[INFO] Finished at: 2014-07-16T10:19:02+00:00
[INFO] Final Memory: 8M/59M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project clog-api: Could not resolve dependencies for project org.sakaiproject.clog:clog-api:jar:0.9.5-SNAPSHOT: Failed to collect dependencies at org.sakaiproject.kernel:sakai-kernel-api:jar:10.0: Failed to read artifact descriptor for org.sakaiproject.kernel:sakai-kernel-api:jar:10.0: Failure to find org.sakaiproject:kernel:pom:10.0 in http://repo1.maven.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/DependencyResolutionException
Additionally... I notice the donwloads are referencing maven2 repositories, I don't suppose that makes any difference, I'm definitely using maven3...
-bash-3.2$ mvn -v
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
Maven home: /usr/local/maven2/current
Java version: 1.6.0_27, vendor: Sun Microsystems Inc.
Java home: /usr/local/java/jdk1.6.0_27/jre
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "2.6.18-348.18.1.el5", arch: "amd64", family: "unix"
Further edit:
D'OH!!!
It works now, I changed the pom only in the way suggested (10-SNAPSHOT -> 10) and --> "compiled as root" <-- what I was doing before was compiling as a non-super user, it looks like the initial build was compiled with root and/or I have permissions wrong somewhere, but clog is now compiling.
I think I'm going to submit a pull request to adrian for the pom change though...
It looks like Clog is setup correctly. You need to have the parent that this is depending on checked out (master) and built locally if you're doing a full source compile. Then you can build clog.
https://confluence.sakaiproject.org/pages/viewpage.action?pageId=93028745
Optionally you can change the version to 10.0 (which has released dependencies) and clog will compile. For instance:
--- a/pom.xml
+++ b/pom.xml
## -12,7 +12,7 ##
<parent>
<groupId>org.sakaiproject</groupId>
<artifactId>master</artifactId>
- <version>10.0-SNAPSHOT</version>
+ <version>10.0</version>
<relativePath>../master/pom.xml</relativePath>
</parent>
The externals for the tools which are on nightly and are known to work on 10 is here.
https://source.sakaiproject.org/svn/sakai/branches/sakai-trunk-experimental/.externals

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.

500 error when using github site-maven-plugin to publish directory to gh-pages

I'm trying to use the github site plugin to copy a directory to my gh-pages branch on github. I'm getting a 500 error whenever I try, though.
Here's my build configuration:
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.7</version>
<configuration>
<message>Creating site for ${project.version}</message>
<branch>gh-pages</branch>
<noJekyll>true</noJekyll>
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
<includes>
<include>**/*</include>
</includes>
<repositoryName>greenDAO</repositoryName>
<repositoryOwner>emmby</repositoryOwner>
</configuration>
</plugin>
Here's the output of mvn ghSite:site
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DaoCore 1.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- site-maven-plugin:0.7:site (default-cli) # greendao ---
[INFO] Creating 12 blobs
[INFO] Creating tree with 13 blob entries
[INFO] Creating commit with SHA-1: 656a23ffd7d898c2d45a107ee4f8f2d8ee86706e
[INFO] Creating reference gh-pages starting at commit 656a23ffd7d898c2d45a107ee4f8f2d8ee86706e
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.608s
[INFO] Finished at: Sat Dec 22 22:25:21 MST 2012
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.7:site (default-cli) on project greendao: Error creating reference: Server Error (500) -> [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
You can find the full output of mvn -X ghSite:site here.
Any ideas what I might be doing wrong?
(My authentication credentials are in my ~/.m2/settings.xml file and appear to be correct, since the push fails with an authentication error if I comment them out.)
Your branch is incorrect:
<branch>gh-pages</branch>
Remove it and use the default.
Did you try this maven plugin http://maven.apache.org/plugins/maven-scm-publish-plugin/various-tips.html ?

Resources