Skip to content

Commit b1c8ec7

Browse files
committed
GH-1272 Remove Maven Resource Resolver dependency
This commit effectively removes dependency on spring-cloud-deployer Resolves #1272
1 parent c2bc868 commit b1c8ec7

File tree

8 files changed

+1489
-8
lines changed

8 files changed

+1489
-8
lines changed

spring-cloud-function-deployer/pom.xml

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
<properties>
1717
<java.version>17</java.version>
18+
<commons-io.version>2.16.1</commons-io.version>
19+
<maven.version>3.9.6</maven.version>
20+
<maven-resolver.version>1.9.18</maven-resolver.version>
21+
<maven-wagon.version>3.5.3</maven-wagon.version>
1822
</properties>
1923

2024
<dependencies>
@@ -34,11 +38,7 @@
3438
<groupId>org.springframework.cloud</groupId>
3539
<artifactId>spring-cloud-function-context</artifactId>
3640
</dependency>
37-
<dependency>
38-
<groupId>org.springframework.cloud</groupId>
39-
<artifactId>spring-cloud-deployer-resource-maven</artifactId>
40-
<version>2.5.1</version>
41-
</dependency>
41+
4242
<dependency>
4343
<groupId>org.springframework.boot</groupId>
4444
<artifactId>spring-boot-starter-test</artifactId>
@@ -55,6 +55,66 @@
5555
<version>2.2.0</version>
5656
<scope>test</scope>
5757
</dependency>
58+
59+
<dependency>
60+
<groupId>org.apache.maven</groupId>
61+
<artifactId>maven-model-builder</artifactId>
62+
<version>${maven.version}</version>
63+
<!-- @TODO boot3 remove when updated -->
64+
<exclusions>
65+
<exclusion>
66+
<groupId>javax.inject</groupId>
67+
<artifactId>javax.inject</artifactId>
68+
</exclusion>
69+
</exclusions>
70+
</dependency>
71+
<dependency>
72+
<groupId>org.apache.maven</groupId>
73+
<artifactId>maven-resolver-provider</artifactId>
74+
<version>${maven.version}</version>
75+
<!-- @TODO boot3 remove when updated -->
76+
<exclusions>
77+
<exclusion>
78+
<groupId>javax.inject</groupId>
79+
<artifactId>javax.inject</artifactId>
80+
</exclusion>
81+
</exclusions>
82+
</dependency>
83+
<dependency>
84+
<groupId>org.apache.maven.resolver</groupId>
85+
<artifactId>maven-resolver-connector-basic</artifactId>
86+
<version>${maven-resolver.version}</version>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.apache.maven.resolver</groupId>
90+
<artifactId>maven-resolver-transport-file</artifactId>
91+
<version>${maven-resolver.version}</version>
92+
</dependency>
93+
<dependency>
94+
<groupId>org.apache.maven.resolver</groupId>
95+
<artifactId>maven-resolver-transport-http</artifactId>
96+
<version>${maven-resolver.version}</version>
97+
</dependency>
98+
<dependency>
99+
<groupId>org.apache.maven.resolver</groupId>
100+
<artifactId>maven-resolver-transport-wagon</artifactId>
101+
<version>${maven-resolver.version}</version>
102+
</dependency>
103+
<dependency>
104+
<groupId>org.apache.maven.resolver</groupId>
105+
<artifactId>maven-resolver-impl</artifactId>
106+
<version>${maven-resolver.version}</version>
107+
</dependency>
108+
<dependency>
109+
<groupId>commons-io</groupId>
110+
<artifactId>commons-io</artifactId>
111+
<version>2.19.0</version>
112+
</dependency>
113+
<dependency>
114+
<groupId>org.apache.maven.wagon</groupId>
115+
<artifactId>wagon-http</artifactId>
116+
<version>3.5.3</version>
117+
</dependency>
58118
</dependencies>
59119

60120
<build>

spring-cloud-function-deployer/src/main/java/org/springframework/cloud/function/deployer/FunctionDeployerConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
import org.springframework.boot.loader.archive.Archive;
3535
import org.springframework.boot.loader.archive.ExplodedArchive;
3636
import org.springframework.boot.loader.archive.JarFileArchive;
37-
import org.springframework.cloud.deployer.resource.maven.MavenProperties;
38-
import org.springframework.cloud.deployer.resource.maven.MavenResourceLoader;
3937
import org.springframework.cloud.function.context.FunctionProperties;
4038
import org.springframework.cloud.function.context.FunctionRegistry;
39+
import org.springframework.cloud.function.deployer.utils.MavenProperties;
40+
import org.springframework.cloud.function.deployer.utils.MavenResourceLoader;
4141
import org.springframework.context.ApplicationContext;
4242
import org.springframework.context.SmartLifecycle;
4343
import org.springframework.context.annotation.Bean;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
* Copyright 2019-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cloud.function.deployer.utils;
18+
19+
import org.eclipse.aether.AbstractRepositoryListener;
20+
import org.eclipse.aether.RepositoryEvent;
21+
import org.slf4j.Logger;
22+
import org.slf4j.LoggerFactory;
23+
24+
/**
25+
* @author Corneil du Plessis
26+
*/
27+
public class LoggingRepositoryListener extends AbstractRepositoryListener {
28+
29+
private static final Logger logger = LoggerFactory.getLogger(LoggingRepositoryListener.class);
30+
31+
public void artifactDeployed(RepositoryEvent event) {
32+
println("artifactDeployed", event.getArtifact() + " to " + event.getRepository());
33+
}
34+
35+
public void artifactDeploying(RepositoryEvent event) {
36+
println("artifactDeploying", event.getArtifact() + " to " + event.getRepository());
37+
}
38+
39+
public void artifactDescriptorInvalid(RepositoryEvent event) {
40+
println("artifactDescriptorInvalid", "for " + event.getArtifact() + ": " + event.getException().getMessage());
41+
}
42+
43+
public void artifactDescriptorMissing(RepositoryEvent event) {
44+
println("artifactDescriptorMissing", "for " + event.getArtifact());
45+
}
46+
47+
public void artifactInstalled(RepositoryEvent event) {
48+
println("artifactInstalled", event.getArtifact() + " to " + event.getFile());
49+
}
50+
51+
public void artifactInstalling(RepositoryEvent event) {
52+
println("artifactInstalling", event.getArtifact() + " to " + event.getFile());
53+
}
54+
55+
public void artifactResolved(RepositoryEvent event) {
56+
println("artifactResolved", event.getArtifact() + " from " + event.getRepository());
57+
}
58+
59+
public void artifactDownloading(RepositoryEvent event) {
60+
println("artifactDownloading", event.getArtifact() + " from " + event.getRepository());
61+
}
62+
63+
public void artifactDownloaded(RepositoryEvent event) {
64+
println("artifactDownloaded", event.getArtifact() + " from " + event.getRepository());
65+
}
66+
67+
public void artifactResolving(RepositoryEvent event) {
68+
println("artifactResolving", event.getArtifact().toString());
69+
}
70+
71+
public void metadataDeployed(RepositoryEvent event) {
72+
println("metadataDeployed", event.getMetadata() + " to " + event.getRepository());
73+
}
74+
75+
public void metadataDeploying(RepositoryEvent event) {
76+
println("metadataDeploying", event.getMetadata() + " to " + event.getRepository());
77+
}
78+
79+
public void metadataInstalled(RepositoryEvent event) {
80+
println("metadataInstalled", event.getMetadata() + " to " + event.getFile());
81+
}
82+
83+
public void metadataInstalling(RepositoryEvent event) {
84+
println("metadataInstalling", event.getMetadata() + " to " + event.getFile());
85+
}
86+
87+
public void metadataInvalid(RepositoryEvent event) {
88+
println("metadataInvalid", event.getMetadata().toString());
89+
}
90+
91+
public void metadataResolved(RepositoryEvent event) {
92+
println("metadataResolved", event.getMetadata() + " from " + event.getRepository());
93+
}
94+
95+
public void metadataResolving(RepositoryEvent event) {
96+
println("metadataResolving", event.getMetadata() + " from " + event.getRepository());
97+
}
98+
99+
private void println(String event, String message) {
100+
logger.info("Aether Repository - " + event + ": " + message);
101+
}
102+
}

0 commit comments

Comments
 (0)