Skip to content

Commit

Permalink
chore: change deprecated quarkus property
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Jan 9, 2025
1 parent c6fc6af commit 3c0c67d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/builder/quarkus.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func generateQuarkusProjectCommon(runtimeProvider v1.RuntimeProvider, runtimeVer
p.Build = &maven.Build{Plugins: make([]maven.Plugin, 0)}

// set fast-jar packaging by default, since it gives some startup time improvements
p.Properties.Add("quarkus.package.type", "fast-jar")
p.Properties.Add("quarkus.package.jar.type", "fast-jar")
// Reproducible builds: https://maven.apache.org/guides/mini/guide-reproducible-builds.html
p.Properties.Add("project.build.outputTimestamp", time.Now().Format(time.RFC3339))
// DependencyManagement
Expand Down
2 changes: 1 addition & 1 deletion pkg/builder/quarkus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestGenerateQuarkusProjectCommon(t *testing.T) {
assert.Equal(t, "org.apache.camel.k.integration", p.GroupID)
assert.Equal(t, "camel-k-integration", p.ArtifactID)
assert.Equal(t, defaults.Version, p.Version)
assert.Equal(t, "fast-jar", p.Properties["quarkus.package.type"])
assert.Equal(t, "fast-jar", p.Properties["quarkus.package.jar.type"])
assert.Equal(t, "org.apache.camel.k", p.DependencyManagement.Dependencies[0].GroupID)
assert.Equal(t, "camel-k-runtime-bom", p.DependencyManagement.Dependencies[0].ArtifactID)
assert.Equal(t, "1.2.3", p.DependencyManagement.Dependencies[0].Version)
Expand Down
4 changes: 2 additions & 2 deletions pkg/builder/runtime_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (n *NativeSourcesAdapter) TargetDirectory(ctxPath, runner string) string {

// NativeMavenProperty -- .
func (n *NativeSourcesAdapter) NativeMavenProperty() string {
return "native-sources"
return "quarkus.native.sources-only"
}

// NativeAdapter used for Camel Quarkus runtime < 3.5.0.
Expand All @@ -64,7 +64,7 @@ type NativeAdapter struct {
// BuildCommands -- .
func (n *NativeAdapter) BuildCommands() string {
// We must override the local repo as it's not shared from the builder container
return "cd " + n.Directory() + " && ./mvnw $(cat MAVEN_CONTEXT) package -Dquarkus.package.type=native -Dmaven.repo.local=./repo"
return "cd " + n.Directory() + " && ./mvnw $(cat MAVEN_CONTEXT) package -Dquarkus.native.enabled=true -Dmaven.repo.local=./repo"
}

// Directory -- .
Expand Down
4 changes: 2 additions & 2 deletions pkg/trait/quarkus.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func (t *quarkusTrait) applyWhenBuildSubmitted(e *Environment) error {
//nolint:nestif
if native {
if nativePackageType := builder.QuarkusRuntimeSupport(e.CamelCatalog.GetCamelQuarkusVersion()).NativeMavenProperty(); nativePackageType != "" {
buildTask.Maven.Properties["quarkus.package.type"] = nativePackageType
buildTask.Maven.Properties[nativePackageType] = "true"
if t.NativeBaseImage == "" {
packageTask.BaseImage = QuarkusNativeDefaultBaseImageName
} else {
Expand All @@ -400,7 +400,7 @@ func (t *quarkusTrait) applyWhenBuildSubmitted(e *Environment) error {
packageSteps = append(packageSteps, builder.Image.ExecutableDockerfile)
} else {
// Default, if nothing is specified
buildTask.Maven.Properties["quarkus.package.type"] = string(fastJarPackageType)
buildTask.Maven.Properties["quarkus.package.jar.type"] = string(fastJarPackageType)
packageSteps = append(packageSteps, builder.Quarkus.ComputeQuarkusDependencies)
if t.isIncrementalImageBuild(e) {
packageSteps = append(packageSteps, builder.Image.IncrementalImageContext)
Expand Down
2 changes: 1 addition & 1 deletion script/camel-k-runtime-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<version>2.0.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<quarkus.package.type>fast-jar</quarkus.package.type>
<quarkus.package.jar.type>fast-jar</quarkus.package.jar.type>
<runtime.version>${RUNTIME_VERSION_CMD}</runtime.version>
<quarkus.version>${QUARKUS_VERSION_CMD}</quarkus.version>
</properties>
Expand Down
4 changes: 2 additions & 2 deletions script/offline_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ cat <<EOF > ${pom}
<version>0.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<quarkus.package.type>fast-jar</quarkus.package.type>
<quarkus.package.jar.type>fast-jar</quarkus.package.jar.type>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
Expand Down Expand Up @@ -244,7 +244,7 @@ cat <<EOF > ${pom_min}
<version>0.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<quarkus.package.type>fast-jar</quarkus.package.type>
<quarkus.package.jar.type>fast-jar</quarkus.package.jar.type>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
Expand Down

0 comments on commit 3c0c67d

Please sign in to comment.