Coder Social home page Coder Social logo

Maven Buildpack fails with code 145 about java HOT 7 CLOSED

pax95 avatar pax95 commented on May 6, 2024
Maven Buildpack fails with code 145

from java.

Comments (7)

pax95 avatar pax95 commented on May 6, 2024 1

Ahh now it's getting clear to me. The buildpack sees a mvnw script in the project and uses that to run/download maven. This script has not been updated since we run vanilla maven locally. Updating the script or removing it will properly solve the issue.

from java.

pax95 avatar pax95 commented on May 6, 2024

Realized that this possibly should have been raised here https://github.com/paketo-buildpacks/maven

You get the same output when running ❯ pack build foo --builder paketobuildpacks/builder:base on a maven based java 11 project

from java.

dmikusa avatar dmikusa commented on May 6, 2024

The suggested solution here would be to use a newer version of Maven. The flag mentioned in the error, --no-transfer-progress is from Maven 3.6.1 (2019). You should use a version of Maven newer than that.

By default, the buildpack will install a version of Maven that is newer than 3.6.1 and compatible with this argument. However, if you are using Maven Wrapper, then the version of Maven is dictated by the Maven wrapper present in your application. You likely need to update your Maven wrapper so it's using a newer version. Then next time you build, the buildpack will use that version of Maven.

If you cannot update Maven for some reason, set the env variable BP_MAVEN_BUILD_ARGUMENTS to -Dmaven.test.skip=true package with pack build -e BP_MAVEN_BUILD_ARGUMENTS='-Dmaven.test.skip=true package'. That will override the default set of Maven arguments and remove the one incompatible with your older version of Maven.

from java.

pax95 avatar pax95 commented on May 6, 2024

The project is not using any wrapper and will rely on the maven buildpack for taking action on installing the correct maven version. I have verified that this is happening on a java 17 project, but not when java 11 project ??
Here is the output from the java 17 project where maven is contributing ->
Paketo Maven Buildpack 6.5.0
https://github.com/paketo-buildpacks/maven
Build Configuration:
$BP_MAVEN_BUILD_ARGUMENTS -Dmaven.test.skip=true --no-transfer-progress package the arguments to pass to Maven
$BP_MAVEN_BUILT_ARTIFACT target/*.[ejw]ar the built application artifact explicitly. Supersedes $BP_MAVEN_BUILT_MODULE
$BP_MAVEN_BUILT_MODULE the module to find application artifact in
$BP_MAVEN_DAEMON_ENABLED false use maven daemon
$BP_MAVEN_POM_FILE pom.xml the location of the main pom.xml file, relative to the application root
Apache Maven 3.8.5: Contributing to layer
Downloading from https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.tar.gz
Verifying checksum
Expanding to /layers/paketo-buildpacks_maven/maven
Creating cache directory /home/cnb/.m2

I think this i a bug in the builder, and that I know that i can temporary fix this by overriding the MAVEN_BUILD_ARGUEMENTS as stated.

from java.

dmikusa avatar dmikusa commented on May 6, 2024
Executing mvnw --batch-mode -Dmaven.test.skip=true --no-transfer-progress package

In your original post, it says mvnw ^^^. Are you certain?

I can take a closer look if you include the full output from building, as well as the full pack buildcommand you're running. It's hard to say what might be happening without the full output. Or if you can include a sample project, I can try to reproduce it on my end. Thanks

from java.

pax95 avatar pax95 commented on May 6, 2024

Closing this now. Thanks for pointing me in the right direction :-)

from java.

dmikusa avatar dmikusa commented on May 6, 2024

No problem, happy to help.

from java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.