Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private Map<String,Credentials> extractCredentialsFromSettings(File settingsFile
final Map<String,Credentials> result = new HashMap<>();

for ( Element serverElement : serverElements ) {
final String id = DomHelper.extractValue( serverElement.element( "id" ) );
final String id = extractValue( serverElement.element( "id" ) );
if ( id == null ) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public void testPluginEncryptedFunction() {

@Test
public void testPluginEnvironmentFunction() {
environmentVariables.set( "SERVER_ID", "id" );
environmentVariables.set( "SERVER_USERNAME", "clu" );
environmentVariables.set( "SERVER_PASSWORD", "xyz" );

Expand All @@ -137,7 +138,7 @@ public void testPluginEnvironmentFunction() {
project.getPluginManager().apply( "maven" );
project.getPluginManager().apply( "maven-publish" );

final String serverId = "environment-server";
final String serverId = "environment-server-id";

applyRepositories( project, serverId, HTTP_REPO );

Expand All @@ -149,6 +150,7 @@ public void testPluginEnvironmentFunction() {

@Test
public void testPluginSystemPropertyFunction() {
System.setProperty( "user.id", "testid" );
System.setProperty( "user.name", "admin" );
System.setProperty( "user.top.secret.password", "top-secret-password" );

Expand All @@ -163,7 +165,7 @@ public void testPluginSystemPropertyFunction() {
project.getPluginManager().apply( "maven" );
project.getPluginManager().apply( "maven-publish" );

final String serverId = "system-properties-server";
final String serverId = "system-properties-server-testid";

applyRepositories( project, serverId, HTTP_REPO );

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/env/environment-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<servers>
<server>
<id>environment-server</id>
<id>environment-server-${env.SERVER_ID}</id>
<username>${env.SERVER_USERNAME}</username>
<password>${env.SERVER_PASSWORD}</password>
</server>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/env/system-properties-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<servers>
<server>
<id>system-properties-server</id>
<id>system-properties-server-${user.id}</id>
<username>${user.name}</username>
<password>${user.top.secret.password}</password>
</server>
Expand Down