private boolean addApplicationVersion()

in taverna-maven-plugin/src/main/java/org/apache/taverna/mavenplugin/TavernaProfileDeployMojo.java [214:237]


	private boolean addApplicationVersion(Versions applicationVersions,
			ApplicationProfile applicationProfile, String profileURL) {
		Version latestVersion = applicationVersions.getLatestVersion();
		if (latestVersion != null
				&& latestVersion.getVersion().equals(applicationProfile.getVersion())) {
			getLog().error(
					String.format("%1$s version %2$s has already been deployed",
							applicationProfile.getName(), applicationProfile.getVersion()));
			return false;
		}

		Version newApplicationVersion = new Version();
		newApplicationVersion.setVersion(applicationProfile.getVersion());
		newApplicationVersion.setFile(profileURL);

		getLog().info(
				String.format("Adding %1$s version %2$s", applicationProfile.getName(),
						applicationProfile.getVersion()));
		if (applicationVersions.getLatestVersion() != null) {
			applicationVersions.getPreviousVersion().add(applicationVersions.getLatestVersion());
		}
		applicationVersions.setLatestVersion(newApplicationVersion);
		return true;
	}