void () { MavenRunConfiguration.MavenSettings s = new MavenRunConfiguration.MavenSettings(myProject); s.myRunnerParameters.setWorkingDirPath("some path"); s.myRunnerParameters.setGoals(Arrays.asList("clean", "validate")); s.myRunnerParameters.setProfilesMap(ImmutableMap.<String, Boolean>builder() .put("prof1", true) .put("prof2", true) .put("prof3", false) .put("aaa", true) .put("tomcat (local)", false) .put("tomcat (local) ", true).build()); s.myGeneralSettings = new MavenGeneralSettings(myProject); s.myGeneralSettings.setChecksumPolicy(MavenExecutionOptions.ChecksumPolicy.WARN); s.myGeneralSettings.setFailureBehavior(MavenExecutionOptions.FailureMode.AT_END); s.myGeneralSettings.setOutputLevel(MavenExecutionOptions.LoggingLevel.FATAL); s.myGeneralSettings.setThreads("1.5C"); s.myRunnerSettings = new MavenRunnerSettings(); s.myRunnerSettings.setMavenProperties(ImmutableMap.of("a", "1", "b", "2", "c", "3")); Element xml = XmlSerializer.serialize(s); MavenRunConfiguration.MavenSettings loaded = XmlSerializer.deserialize(xml, MavenRunConfiguration.MavenSettings.class); assertEquals(s.myRunnerParameters.getWorkingDirPath(), loaded.myRunnerParameters.getWorkingDirPath()); assertEquals(s.myRunnerParameters.getGoals(), loaded.myRunnerParameters.getGoals()); assertEquals(s.myRunnerParameters.getProfilesMap(), loaded.myRunnerParameters.getProfilesMap()); assertOrderedEquals(s.myRunnerParameters.getProfilesMap().keySet(), loaded.myRunnerParameters.getProfilesMap().keySet()); // Compare ordering of profiles. assertEquals(s.myGeneralSettings, loaded.myGeneralSettings); assertEquals(s.myRunnerSettings, loaded.myRunnerSettings); }