diff --git a/maven-model/src/main/mdo/maven.mdo b/maven-model/src/main/mdo/maven.mdo
index 41f23919fe..2bd344e1bf 100644
--- a/maven-model/src/main/mdo/maven.mdo
+++ b/maven-model/src/main/mdo/maven.mdo
@@ -618,6 +618,18 @@
]]>
+
+ 4.0.0+
+
+
+
+
@@ -641,6 +653,22 @@
+
+
+ 4.0.0+
+
+
+
+
+
BuildBase
@@ -715,6 +743,22 @@
+
+
+ 4.0.0+
+
+
+
+
+
Build
@@ -792,6 +836,22 @@
+
+
+ 4.0.0+
+
+
+
+
+
CiManagement
@@ -971,6 +1031,22 @@
+
+
+ 4.0.0+
+
+
+
+
+
Dependency
@@ -1179,6 +1255,22 @@
String
+
+
+ 4.0.0+
+
+
+
+
+
Exclusion
@@ -1225,6 +1317,22 @@
String
+
+
+ 4.0.0+
+
+
+
+
+
DistributionManagement
@@ -1346,6 +1454,22 @@
String
+
+
+ 4.0.0+
+
+
+
+
+
MailingList
@@ -1421,6 +1545,22 @@
We could probably have a specific element for a dev mailing list for things like CI,
and maybe even a specific element for the user and scm mailing lists. Then leave the more
lose structure for any other type of mailing list.
+
+
+ 4.0.0+
+
+
+
+
+
Organization
@@ -1440,6 +1580,22 @@
String
+
+
+ 4.0.0+
+
+
+
+
+
PatternSet
@@ -1737,6 +1893,20 @@
]]>
+
+ 4.0.0+
+
+
+
+
diff --git a/maven-model/src/test/java/org/apache/maven/model/BuildTest.java b/maven-model/src/test/java/org/apache/maven/model/BuildTest.java
index 2512d3cc48..d1343a6488 100644
--- a/maven-model/src/test/java/org/apache/maven/model/BuildTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/BuildTest.java
@@ -45,4 +45,12 @@ public class BuildTest extends TestCase {
public void testToStringNullSafe() {
assertNotNull(new Build().toString());
}
+
+ public void testToStringNotNonsense() {
+ Build build = new Build();
+
+ String s = build.toString();
+
+ assert "Build {BuildBase {PluginConfiguration {PluginContainer {}}}}".equals(s) : s;
+ }
}
diff --git a/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java b/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java
index cc29e4dd4b..e54767e280 100644
--- a/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java
@@ -45,4 +45,15 @@ public class DeveloperTest extends TestCase {
public void testToStringNullSafe() {
assertNotNull(new Developer().toString());
}
+
+ public void testToStringNotNonsense() {
+ Developer dev = new Developer();
+ dev.setName("Maven Tester");
+ dev.setEmail("tester@acme.localdomain");
+ dev.setId("20220118");
+
+ String s = dev.toString();
+
+ assert "Developer {id=20220118, Contributor {name=Maven Tester, email=tester@acme.localdomain}}".equals(s) : s;
+ }
}
diff --git a/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java
index 5a30d1c1ea..371030b413 100644
--- a/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java
@@ -45,4 +45,14 @@ public class IssueManagementTest extends TestCase {
public void testToStringNullSafe() {
assertNotNull(new IssueManagement().toString());
}
+
+ public void testToStringNotNonsense() {
+ IssueManagement im = new IssueManagement();
+ im.setSystem("Velociraptor");
+ im.setUrl("https://velo.localdomain");
+
+ String s = im.toString();
+
+ assert "IssueManagement {system=Velociraptor, url=https://velo.localdomain}".equals(s) : s;
+ }
}
diff --git a/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java b/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java
index 4739726be4..a8f5b81dc5 100644
--- a/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java
@@ -45,4 +45,14 @@ public class LicenseTest extends TestCase {
public void testToStringNullSafe() {
assertNotNull(new License().toString());
}
+
+ public void testToStringNotNonsense() {
+ License license = new License();
+ license.setName("Unlicense");
+ license.setUrl("http://lic.localdomain");
+
+ String s = license.toString();
+
+ assert "License {name=Unlicense, url=http://lic.localdomain}".equals(s) : s;
+ }
}
diff --git a/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java b/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java
index 3817cc06ad..ba0cd7620b 100644
--- a/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java
@@ -45,4 +45,13 @@ public class MailingListTest extends TestCase {
public void testToStringNullSafe() {
assertNotNull(new MailingList().toString());
}
+
+ public void testToStringNotNonsense() {
+ MailingList list = new MailingList();
+ list.setName("modello-dev");
+
+ String s = list.toString();
+
+ assertEquals("MailingList {name=modello-dev, archive=null}", s);
+ }
}
diff --git a/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java b/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java
index 72a1994f96..468cc39746 100644
--- a/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java
@@ -45,4 +45,32 @@ public class OrganizationTest extends TestCase {
public void testToStringNullSafe() {
assertNotNull(new Organization().toString());
}
+
+ public void testToStringNotNonsense11() {
+ Organization org = new Organization();
+ org.setName("Testing Maven Unit");
+ org.setUrl("https://maven.localdomain");
+
+ assertEquals("Organization {name=Testing Maven Unit, url=https://maven.localdomain}", org.toString());
+ }
+
+ public void testToStringNotNonsense10() {
+ Organization org = new Organization();
+ org.setName("Testing Maven Unit");
+
+ assertEquals("Organization {name=Testing Maven Unit, url=null}", org.toString());
+ }
+
+ public void testToStringNotNonsense01() {
+ Organization org = new Organization();
+ org.setUrl("https://maven.localdomain");
+
+ assertEquals("Organization {name=null, url=https://maven.localdomain}", org.toString());
+ }
+
+ public void testToStringNotNonsense00() {
+ Organization org = new Organization();
+
+ assertEquals("Organization {name=null, url=null}", org.toString());
+ }
}
diff --git a/maven-model/src/test/java/org/apache/maven/model/ScmTest.java b/maven-model/src/test/java/org/apache/maven/model/ScmTest.java
index f4a374838a..e733c10f55 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ScmTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ScmTest.java
@@ -45,4 +45,13 @@ public class ScmTest extends TestCase {
public void testToStringNullSafe() {
assertNotNull(new Scm().toString());
}
+
+ public void testToStringNotNonsense() {
+ Scm scm = new Scm();
+ scm.setConnection("scm:git:git://git.localdomain/model");
+
+ String s = scm.toString();
+
+ assertEquals("Scm {connection=scm:git:git://git.localdomain/model}", s);
+ }
}