Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ under the License.
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<!-- reusing component to configure Wagon -->
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-wagon</artifactId>
<version>1.4.1</version>
<!-- version shipping with Maven 3.6.3-->
<scope>compile</scope>
Copy link
Member Author

@kwin kwin Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this provided from the Maven Core classloader?

Copy link
Member

@michael-o michael-o Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cstamas Do you remember what we have changed back them for Maven 3.9.x and Resolver 1.9.x/2.0.x?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cstamas Do you remember what we have changed back them for Maven 3.9.x and Resolver 1.9.x/2.0.x?

Nope, but Wagon transport works even today in Maven 3 and even in 4... so unsure what site dropped and why.

</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
import org.apache.maven.wagon.observers.Debug;
import org.apache.maven.wagon.proxy.ProxyInfo;
import org.apache.maven.wagon.repository.Repository;
import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.eclipse.aether.transport.wagon.WagonConfigurator;

/**
* Abstract base class for deploy mojos.
Expand Down Expand Up @@ -129,6 +132,8 @@ public abstract class AbstractDeployMojo extends AbstractSiteMojo {
@Inject
SettingsDecrypter settingsDecrypter;

@Inject
private WagonConfigurator wagonConfigurator;
/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -285,6 +290,28 @@ private Wagon getWagon(final Repository repository) throws MojoExecutionExceptio
throw new MojoExecutionException(
"Wagon protocol '" + repository.getProtocol() + "' doesn't support directory copying");
}
// retrieve relevant settings
Server server = settings.getServer(repository.getId());
// taken over from
// https://github.com/apache/maven/blob/18a52647884dcc822eb04bf5a3265a21dc83256c/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java#L242
if (server != null && server.getConfiguration() != null) {
Xpp3Dom dom = (Xpp3Dom) server.getConfiguration();
for (int i = dom.getChildCount() - 1; i >= 0; i--) {
Xpp3Dom child = dom.getChild(i);
if ("wagonProvider".equals(child.getName())) {
dom.removeChild(i);
}
}
XmlPlexusConfiguration config = new XmlPlexusConfiguration(dom);
try {
// use Wagon configurator from Resolver
wagonConfigurator.configure(wagon, config);
} catch (Exception e) {
throw new MojoExecutionException(
"Error configuring wagon with server configuration for server id '" + repository.getId() + "'",
e);
}
}
return wagon;
}

Expand Down
Loading