diff --git a/README.md b/README.md index 3635c2e..23d0cda 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # `gcr.io/paketo-buildpacks/maven` + The Paketo Maven Buildpack is a Cloud Native Buildpack that builds Maven-based applications from source. ## Behavior + This buildpack will participate all the following conditions are met * `/pom.xml` exists or `BP_MAVEN_POM_FILE` is set to an existing POM file. @@ -23,29 +25,34 @@ The buildpack will do the following: * Restores the files matched by `$BP_MAVEN_BUILT_ARTIFACT` to `` ## Configuration + | Environment Variable | Description | | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `$BP_MAVEN_BUILD_ARGUMENTS` | Configure the arguments to pass to Maven. Defaults to `-Dmaven.test.skip=true package`. `--batch-mode` will be prepended to the argument list in environments without a TTY. | | `$BP_MAVEN_BUILT_MODULE` | Configure the module to find application artifact in. Defaults to the root module (empty). | -| `$BP_MAVEN_BUILT_ARTIFACT` | Configure the built application artifact explicitly. Supersedes `$BP_MAVEN_BUILT_MODULE` Defaults to `target/*.[ejw]ar`. Can match a single file, multiple files or a directory. | +| `$BP_MAVEN_BUILT_ARTIFACT` | Configure the built application artifact explicitly. Supersedes `$BP_MAVEN_BUILT_MODULE` Defaults to `target/*.[ejw]ar`. Can match a single file, multiple files or a directory. Can be one or more space separated patterns. | | `$BP_MAVEN_POM_FILE` | Specifies a custom location to the project's `pom.xml` file. It should be a full path to the file under the `/workspace` directory or it should be relative to the root of the project (i.e. `/workspace'). Defaults to `pom.xml`. | | `$BP_MAVEN_DAEMON_ENABLED` | Triggers apache maven-mvnd to be installed and configured for use instead of Maven. The default value is `false`. Set to `true` to use the Maven Daemon. | ## Bindings + The buildpack optionally accepts the following bindings: ### Type: `maven` + | Secret | Description | | ----------------------- | ------------------------------------------------------------------------------------------------------ | | `settings.xml` | If present `--settings=` is prepended to the `maven` arguments | | `settings-security.xml` | If present `-Dsettings.security=` is prepended to the `maven` arguments | ### Type: `dependency-mapping` + | Key | Value | Description | | --------------------- | ------- | ------------------------------------------------------------------------------------------------- | | `` | `` | If needed, the buildpack will fetch the dependency with digest `` from `` | ## License + This buildpack is released under version 2.0 of the [Apache License][a]. [a]: http://www.apache.org/licenses/LICENSE-2.0 diff --git a/cmd/main/main.go b/cmd/main/main.go index 1e572e0..af1c64a 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -24,7 +24,7 @@ import ( "github.com/paketo-buildpacks/libpak" "github.com/paketo-buildpacks/libpak/bard" - "github.com/paketo-buildpacks/maven/maven" + "github.com/paketo-buildpacks/maven/v6/maven" ) func main() { diff --git a/go.mod b/go.mod index a34e327..b548e2b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ -module github.com/paketo-buildpacks/maven +module github.com/paketo-buildpacks/maven/v6 -go 1.15 +go 1.17 require ( github.com/buildpacks/libcnb v1.25.5 @@ -10,3 +10,23 @@ require ( github.com/paketo-buildpacks/libpak v1.58.0 github.com/sclevine/spec v1.4.0 ) + +require ( + github.com/BurntSushi/toml v1.0.0 // indirect + github.com/Masterminds/semver/v3 v3.1.1 // indirect + github.com/creack/pty v1.1.17 // indirect + github.com/heroku/color v0.0.6 // indirect + github.com/imdario/mergo v0.3.12 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/mattn/go-colorable v0.1.7 // indirect + github.com/mattn/go-shellwords v1.0.12 // indirect + github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect + github.com/paketo-buildpacks/libjvm v1.35.0 // indirect + github.com/pavel-v-chernykh/keystore-go/v4 v4.3.0 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect + golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985 // indirect + golang.org/x/sys v0.0.0-20220207234003-57398862261d // indirect + golang.org/x/text v0.3.6 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) diff --git a/go.sum b/go.sum index a34abe8..392692a 100644 --- a/go.sum +++ b/go.sum @@ -28,7 +28,6 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/heroku/color v0.0.6 h1:UTFFMrmMLFcL3OweqP1lAdp8i1y/9oHqkeHjQ/b/Ny0= @@ -39,9 +38,11 @@ github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= @@ -113,6 +114,8 @@ golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -136,7 +139,6 @@ golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyj golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/maven/build_test.go b/maven/build_test.go index fe518c7..aa72c71 100644 --- a/maven/build_test.go +++ b/maven/build_test.go @@ -32,7 +32,7 @@ import ( "github.com/paketo-buildpacks/libpak" "github.com/sclevine/spec" - "github.com/paketo-buildpacks/maven/maven" + "github.com/paketo-buildpacks/maven/v6/maven" ) func testBuild(t *testing.T, context spec.G, it spec.S) { diff --git a/maven/detect_test.go b/maven/detect_test.go index ef20593..a46fbb1 100644 --- a/maven/detect_test.go +++ b/maven/detect_test.go @@ -26,7 +26,7 @@ import ( . "github.com/onsi/gomega" "github.com/sclevine/spec" - "github.com/paketo-buildpacks/maven/maven" + "github.com/paketo-buildpacks/maven/v6/maven" ) func testDetect(t *testing.T, context spec.G, it spec.S) { diff --git a/maven/distribution_test.go b/maven/distribution_test.go index 771f662..e8f0604 100644 --- a/maven/distribution_test.go +++ b/maven/distribution_test.go @@ -27,7 +27,7 @@ import ( "github.com/paketo-buildpacks/libpak" "github.com/sclevine/spec" - "github.com/paketo-buildpacks/maven/maven" + "github.com/paketo-buildpacks/maven/v6/maven" ) func testDistribution(t *testing.T, context spec.G, it spec.S) { diff --git a/maven/mvnd_distribution_test.go b/maven/mvnd_distribution_test.go index 49df3f2..a4c496c 100644 --- a/maven/mvnd_distribution_test.go +++ b/maven/mvnd_distribution_test.go @@ -27,7 +27,7 @@ import ( "github.com/paketo-buildpacks/libpak" "github.com/sclevine/spec" - "github.com/paketo-buildpacks/maven/maven" + "github.com/paketo-buildpacks/maven/v6/maven" ) func testMvndDistribution(t *testing.T, context spec.G, it spec.S) { diff --git a/scripts/build.sh b/scripts/build.sh index 296277d..0c1bb60 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,7 +2,7 @@ set -euo pipefail -GOOS="linux" go build -ldflags='-s -w' -tags osusergo -o bin/main github.com/paketo-buildpacks/maven/cmd/main +GOOS="linux" go build -ldflags='-s -w' -tags osusergo -o bin/main github.com/paketo-buildpacks/maven/v6/cmd/main if [ "${STRIP:-false}" != "false" ]; then strip bin/main