spring-io / initializr

A quickstart generator for Spring projects
https://start.spring.io
Apache License 2.0
3.43k stars 1.73k forks source link

Update to Maven Wrapper 3.3.1 #1528

Closed breun closed 4 months ago

breun commented 4 months ago

Update to Maven Wrapper 3.3.1, both for building the project and for projects generated by Spring Initializr.

Note that this is still using the bin type for Maven Wrapper (which includes the binary maven-wrapper.jar), and not the new only-script type, which became the new default with Maven Wrapper 3.3.0. See here for more info about the various installation types.

mhalbritter commented 4 months ago

Thanks! I have switched to the new only-script type and removed the JAR file.

breun commented 4 months ago

@mhalbritter The new maven-wrapper.properties file doesn't look correct for a project using Maven Wrapper 3.3.1 with the default only-script type.

To reproduce what it should look like:

  1. Create and enter a new directory:
❯ mkdir only-script-test && cd only-script-test
  1. Add Maven Wrapper 3.3.1 with type only-script (also the default when omitted) and Maven version 3.9.6 (defaults to the version of Maven used to execute this command when omitted):
❯ mvn wrapper:3.3.1:wrapper -Dtype=only-script -Dmaven=3.9.6
  1. Print Maven Wrapper properties:
❯ cat .mvn/wrapper/maven-wrapper.properties
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.1
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip

So, wrapperVersion should be there, and wrapperUrl shouldn't.

P.S. Maven Wrapper 3.3.2 will add distributionType (MWRAPPER-135).

breun commented 4 months ago

@mhalbritter Maybe Spring Initializr could actually execute the Maven Wrapper plugin goal (via maven-invoker?) to install Maven Wrapper for generated projects, instead of trying to generate the same result?

mhalbritter commented 4 months ago

Oh yeah, you're right. I've mixed something up. This is now fixed in 5851307b078031b2275341e560a0fe23a153494d and 059066c622b7f54b788532503bd6f2777e200684.