GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [MDEPLOY-320] Simplify and unify message (#64) · apache/maven-deploy-plugin@07948ea

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • main/java/org/apache/maven/plugins/deploy
      • DeployMojo.java
    • test/java/org/apache/maven/plugins/deploy
      • DeployMojoTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java‎

Copy file name to clipboardExpand all lines: src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -382,20 +382,16 @@ RemoteRepository getDeploymentRepository(
382382
+ "\" instead.");
383383
repo = getRemoteRepository(id, url);
384384
} else {
385-
throw new MojoExecutionException(
386-
altDeploymentRepo,
387-
"Invalid legacy syntax and layout for repository.",
388-
"Invalid legacy syntax and layout for alternative repository. Use \"" + id + "::" + url
389-
+ "\" instead, and only default layout is supported.");
385+
throw new MojoExecutionException("Invalid legacy syntax and layout for alternative repository: \""
386+
+ altDeploymentRepo + "\". Use \"" + id + "::" + url
387+
+ "\" instead, and only default layout is supported.");
390388
}
391389
} else {
392390
matcher = ALT_REPO_SYNTAX_PATTERN.matcher(altDeploymentRepo);
393391

394392
if (!matcher.matches()) {
395-
throw new MojoExecutionException(
396-
altDeploymentRepo,
397-
"Invalid syntax for repository.",
398-
"Invalid syntax for alternative repository. Use \"id::url\".");
393+
throw new MojoExecutionException("Invalid syntax for alternative repository: \"" + altDeploymentRepo
394+
+ "\". Use \"id::url\".");
399395
} else {
400396
String id = matcher.group(1).trim();
401397
String url = matcher.group(2).trim();
Collapse file

‎src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java‎

Copy file name to clipboardExpand all lines: src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+18-19Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -711,17 +711,18 @@ public void testLegacyAltDeploymentRepositoryWithLegacyLayout() throws Exception
711711

712712
setVariableValueToObject(mojo, "project", project);
713713
setVariableValueToObject(mojo, "session", session);
714-
setVariableValueToObject(mojo, "altDeploymentRepository", "altDeploymentRepository::legacy::http://localhost");
714+
String altDeploymentRepository = "altDeploymentRepository::legacy::http://localhost";
715+
setVariableValueToObject(mojo, "altDeploymentRepository", altDeploymentRepository);
715716

716717
project.setVersion("1.0-SNAPSHOT");
717718
try {
718-
mojo.getDeploymentRepository(project, null, null, "altDeploymentRepository::legacy::http://localhost");
719+
mojo.getDeploymentRepository(project, null, null, altDeploymentRepository);
719720
fail("Should throw: Invalid legacy syntax and layout for repository.");
720721
} catch (MojoExecutionException e) {
721-
assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository.");
722722
assertEquals(
723-
e.getLongMessage(),
724-
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::http://localhost\" instead, and only default layout is supported.");
723+
e.getMessage(),
724+
"Invalid legacy syntax and layout for alternative repository: \"" + altDeploymentRepository
725+
+ "\". Use \"altDeploymentRepository::http://localhost\" instead, and only default layout is supported.");
725726
}
726727
}
727728

@@ -730,19 +731,18 @@ public void testInsaneAltDeploymentRepository() throws Exception {
730731

731732
setVariableValueToObject(mojo, "project", project);
732733
setVariableValueToObject(mojo, "session", session);
733-
setVariableValueToObject(
734-
mojo, "altDeploymentRepository", "altDeploymentRepository::hey::wow::foo::http://localhost");
734+
String altDeploymentRepository = "altDeploymentRepository::hey::wow::foo::http://localhost";
735+
setVariableValueToObject(mojo, "altDeploymentRepository", altDeploymentRepository);
735736

736737
project.setVersion("1.0-SNAPSHOT");
737738
try {
738-
mojo.getDeploymentRepository(
739-
project, null, null, "altDeploymentRepository::hey::wow::foo::http://localhost");
739+
mojo.getDeploymentRepository(project, null, null, altDeploymentRepository);
740740
fail("Should throw: Invalid legacy syntax and layout for repository.");
741741
} catch (MojoExecutionException e) {
742-
assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository.");
743742
assertEquals(
744-
e.getLongMessage(),
745-
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::wow::foo::http://localhost\" instead, and only default layout is supported.");
743+
e.getMessage(),
744+
"Invalid legacy syntax and layout for alternative repository: \"" + altDeploymentRepository
745+
+ "\". Use \"altDeploymentRepository::wow::foo::http://localhost\" instead, and only default layout is supported.");
746746
}
747747
}
748748

@@ -766,19 +766,18 @@ public void testLegacyScmSvnAltDeploymentRepository() throws Exception {
766766
mojo = new DeployMojo();
767767

768768
setVariableValueToObject(mojo, "project", project);
769-
setVariableValueToObject(
770-
mojo, "altDeploymentRepository", "altDeploymentRepository::legacy::scm:svn:http://localhost");
769+
String altDeploymentRepository = "altDeploymentRepository::legacy::scm:svn:http://localhost";
770+
setVariableValueToObject(mojo, "altDeploymentRepository", altDeploymentRepository);
771771

772772
project.setVersion("1.0-SNAPSHOT");
773773
try {
774-
mojo.getDeploymentRepository(
775-
project, null, null, "altDeploymentRepository::legacy::scm:svn:http://localhost");
774+
mojo.getDeploymentRepository(project, null, null, altDeploymentRepository);
776775
fail("Should throw: Invalid legacy syntax and layout for repository.");
777776
} catch (MojoExecutionException e) {
778-
assertEquals(e.getMessage(), "Invalid legacy syntax and layout for repository.");
779777
assertEquals(
780-
e.getLongMessage(),
781-
"Invalid legacy syntax and layout for alternative repository. Use \"altDeploymentRepository::scm:svn:http://localhost\" instead, and only default layout is supported.");
778+
e.getMessage(),
779+
"Invalid legacy syntax and layout for alternative repository: \"" + altDeploymentRepository
780+
+ "\". Use \"altDeploymentRepository::scm:svn:http://localhost\" instead, and only default layout is supported.");
782781
}
783782
}
784783

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.