	public synchronized void executeMojo() throws MojoExecutionException {
		if ("pom".equalsIgnoreCase(this.mavenProject.getPackaging())) { 
			String key = ArtifactUtils.key(this.mavenProject.getGroupId(), this.mavenProject.getArtifactId(), this.mavenProject.getVersion());
			info("Ignoring project ", 
					key, " because it is a source-less project."); 
			return;
		}
		File classesDirectory = new File(getOutputDirectory(), CLASSES_DIR);
		File metainfDirectory = new File(classesDirectory, METAINF_DIR);
		File licenseDirectory = new File(metainfDirectory, LICENSE_DIR);
		licenseDirectory.mkdirs();
		Set<License> coreInstalled = new HashSet<License>();
		License lic;
		URL resource;
		String filename;
		File licFile;
		Map<String, License> includedLicenses = new HashMap<String,License>();
		Pattern re1 = Pattern.compile("^([^:]+):(.+):(.+)$"); 
		Pattern re2 = Pattern.compile("^([^:]+):(.+)$"); 
		if (this.thirdPartyLicenses != null) {
			for (String tpl : this.thirdPartyLicenses) {
				Matcher matcher = re1.matcher(tpl);
				if (matcher.matches()) {
					String l = matcher.group(1);
					String f = matcher.group(2);
					lic = License.parse(l, null);
					if (lic != null) {
						StringBuilder sb = new StringBuilder();
						sb.append(this.name);
						sb.append("_"); 
						String b = f.replaceAll("[/\\:]", "."); 
						b = b.replaceAll("^\\.", ""); 
						sb.append(b);
						includedLicenses.put(sb.toString(), lic);
					}
				}
				else {
					matcher = re2.matcher(tpl);
					if (matcher.matches()) {
						String l = matcher.group(1);
						String g = matcher.group(2);
						String a = matcher.group(3);
						lic = License.parse(l, null);
						if (lic != null) {
							String depName = "mvndep_"+g+"_"+a; 
							includedLicenses.put(depName, lic);
						}
					}
				}
			}
		}
		try {
			for (String license : this.licenses) {
				lic = License.parse(license, License.GPLv3);
				if (!coreInstalled.contains(lic)) {
					resource = lic.getFullTextResource();
					if (resource != null) {
						filename = LICENSE_FILENAME_PATTERN.replaceAll("%s", this.name); 
						filename = filename.replaceAll("%l", lic.name()); 
						info("Installing license: ", 
								lic.getLicenseName(), ", into ", 
								filename);
						licFile = new File(licenseDirectory, filename);
						fileCopy(resource, licFile);
						coreInstalled.add(lic);
					} else {
						throw new MojoExecutionException("Unable to find the full text of the license: " + lic.getLicenseName()); 
					}
				}
			}
			for (Entry<String, License> licenseMap : includedLicenses.entrySet()) {
				lic = licenseMap.getValue();
				resource = lic.getFullTextResource();
				if (resource != null) {
					filename = LICENSE_FILENAME_PATTERN.replaceAll("%s", licenseMap.getKey()); 
					filename = filename.replaceAll("%l", lic.name()); 
					info("Installing included source code license: ", 
							lic.getLicenseName(), ", into ", 
							filename);
					licFile = new File(licenseDirectory, filename);
					fileCopy(resource, licFile);
				} else {
					throw new MojoExecutionException("Unable to find the full text of the license: " + lic.getLicenseName()); 
				}
			}
			filename = NOTICE_FILENAME_PATTERN.replaceAll("%s", this.name); 
			info("Installing license notice: ", 
					filename);
			StringBuilder addParts = new StringBuilder();
			for (Entry<String, License> licenseMap : includedLicenses.entrySet()) {
				lic = licenseMap.getValue();
				if (lic != null) {
					String s = getLString(InstallLicenseMojo.class, "NOTICE_SENTENCE", 
							lic.getLicenseName(), licenseMap.getKey());
					addParts.append(s);
				}
			}
			StringBuilder fullLicenseText = new StringBuilder();
			int n = 0;
			for (License l : coreInstalled) {
				if (n > 0) {
					if (n == coreInstalled.size() - 1) {
						fullLicenseText.append(getLString(InstallLicenseMojo.class, "AND")); 
					} else {
						fullLicenseText.append(getLString(InstallLicenseMojo.class, "COMMA")); 
					}
				}
				fullLicenseText.append(l.getLicenseName());
				++n;
			}
			String noticeText = getLString(InstallLicenseMojo.class, "NOTICE_TEXT", 
					this.name, this.copyrightDates, this.copyrighters, fullLicenseText.toString(), addParts.toString());
			File noticeFile = new File(metainfDirectory, filename);
			FileWriter fileWriter = new FileWriter(noticeFile);
			try {
				fileWriter.write(noticeText);
			}
			finally {
				fileWriter.close();
			}
			filename = AUTHOR_FILENAME_PATTERN.replaceAll("%s", this.name); 
			info("Installing authors: ", 
					filename);
			StringBuilder authorsText = new StringBuilder();
			if (this.projectURL != null) {
				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", this.projectURL.toExternalForm())); 
			} else {
				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", "")); 
			}
			authorsText.append("\n\n"); 
			authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER_TITLE", this.name)); 
			authorsText.append("\n\n"); 
			for (Developer developer : this.mavenProject.getDevelopers()) {
				authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER", 
						developer.getName(), developer.getEmail()));
				authorsText.append("\n"); 
			}
			authorsText.append("\n\n\n"); 
			authorsText.append(getLString(InstallLicenseMojo.class, "CONTRIBUTOR_TITLE", this.name)); 
			authorsText.append("\n\n"); 
			for (Contributor contributor : this.mavenProject.getContributors()) {
				authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER", 
						contributor.getName(), contributor.getEmail()));
				authorsText.append("\n"); 
			}
			File authorFile = new File(metainfDirectory, filename);
			fileWriter = new FileWriter(authorFile);
			try {
				fileWriter.write(authorsText.toString());
			}
			finally {
				fileWriter.close();
			}
		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	public synchronized void executeMojo() throws MojoExecutionException {
		if ("pom".equalsIgnoreCase(this.mavenProject.getPackaging())) { 
			String key = ArtifactUtils.key(this.mavenProject.getGroupId(), this.mavenProject.getArtifactId(), this.mavenProject.getVersion());
			info("Ignoring project ", 
					key, " because it is a source-less project."); 
			return;
		}
		File classesDirectory = new File(getOutputDirectory(), CLASSES_DIR);
		File metainfDirectory = new File(classesDirectory, METAINF_DIR);
		File licenseDirectory = new File(metainfDirectory, LICENSE_DIR);
		licenseDirectory.mkdirs();
		Set<License> coreInstalled = new HashSet<License>();
		License lic;
		URL resource;
		String filename;
		File licFile;
		Map<String, License> includedLicenses = new HashMap<String,License>();
		Pattern re1 = Pattern.compile("^([^:]+):(.+):(.+)$"); 
		Pattern re2 = Pattern.compile("^([^:]+):(.+)$"); 
		if (this.thirdPartyLicenses != null) {
			for (String tpl : this.thirdPartyLicenses) {
				Matcher matcher = re1.matcher(tpl);
				if (matcher.matches()) {
					String l = matcher.group(1);
					String g = matcher.group(2);
					String a = matcher.group(3);
					lic = License.parse(l, null);
					if (lic != null) {
						String depName = "mvndep_"+g+"_"+a; 
						includedLicenses.put(depName, lic);
					}
				}
				else {
					matcher = re2.matcher(tpl);
					if (matcher.matches()) {
						String l = matcher.group(1);
						String f = matcher.group(2);
						lic = License.parse(l, null);
						if (lic != null) {
							StringBuilder sb = new StringBuilder();
							sb.append(this.name);
							sb.append("_"); 
							String b = f.replaceAll("[/\\:]", "."); 
							b = b.replaceAll("^\\.", ""); 
							sb.append(b);
							includedLicenses.put(sb.toString(), lic);
						}
					}
				}
			}
		}
		try {
			for (String license : this.licenses) {
				lic = License.parse(license, License.GPLv3);
				if (!coreInstalled.contains(lic)) {
					resource = lic.getFullTextResource();
					if (resource != null) {
						filename = LICENSE_FILENAME_PATTERN.replaceAll("%s", this.name); 
						filename = filename.replaceAll("%l", lic.name()); 
						info("Installing license: ", 
								lic.getLicenseName(), ", into ", 
								filename);
						licFile = new File(licenseDirectory, filename);
						fileCopy(resource, licFile);
						coreInstalled.add(lic);
					} else {
						throw new MojoExecutionException("Unable to find the full text of the license: " + lic.getLicenseName()); 
					}
				}
			}
			for (Entry<String, License> licenseMap : includedLicenses.entrySet()) {
				lic = licenseMap.getValue();
				resource = lic.getFullTextResource();
				if (resource != null) {
					filename = LICENSE_FILENAME_PATTERN.replaceAll("%s", licenseMap.getKey()); 
					filename = filename.replaceAll("%l", lic.name()); 
					info("Installing included source code license: ", 
							lic.getLicenseName(), ", into ", 
							filename);
					licFile = new File(licenseDirectory, filename);
					fileCopy(resource, licFile);
				} else {
					throw new MojoExecutionException("Unable to find the full text of the license: " + lic.getLicenseName()); 
				}
			}
			filename = NOTICE_FILENAME_PATTERN.replaceAll("%s", this.name); 
			info("Installing license notice: ", 
					filename);
			StringBuilder addParts = new StringBuilder();
			for (Entry<String, License> licenseMap : includedLicenses.entrySet()) {
				lic = licenseMap.getValue();
				if (lic != null) {
					String s = getLString(InstallLicenseMojo.class, "NOTICE_SENTENCE", 
							lic.getLicenseName(), licenseMap.getKey());
					addParts.append(s);
				}
			}
			StringBuilder fullLicenseText = new StringBuilder();
			int n = 0;
			for (License l : coreInstalled) {
				if (n > 0) {
					if (n == coreInstalled.size() - 1) {
						fullLicenseText.append(getLString(InstallLicenseMojo.class, "AND")); 
					} else {
						fullLicenseText.append(getLString(InstallLicenseMojo.class, "COMMA")); 
					}
				}
				fullLicenseText.append(l.getLicenseName());
				++n;
			}
			String noticeText = getLString(InstallLicenseMojo.class, "NOTICE_TEXT", 
					this.name, this.copyrightDates, this.copyrighters, fullLicenseText.toString(), addParts.toString());
			File noticeFile = new File(metainfDirectory, filename);
			FileWriter fileWriter = new FileWriter(noticeFile);
			try {
				fileWriter.write(noticeText);
			}
			finally {
				fileWriter.close();
			}
			filename = AUTHOR_FILENAME_PATTERN.replaceAll("%s", this.name); 
			info("Installing authors: ", 
					filename);
			StringBuilder authorsText = new StringBuilder();
			if (this.projectURL != null) {
				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", this.projectURL.toExternalForm())); 
			} else {
				authorsText.append(getLString(InstallLicenseMojo.class, "AUTHOR_INTRO", "")); 
			}
			authorsText.append("\n\n"); 
			authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER_TITLE", this.name)); 
			authorsText.append("\n\n"); 
			for (Developer developer : this.mavenProject.getDevelopers()) {
				authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER", 
						developer.getName(), developer.getEmail()));
				authorsText.append("\n"); 
			}
			authorsText.append("\n\n\n"); 
			authorsText.append(getLString(InstallLicenseMojo.class, "CONTRIBUTOR_TITLE", this.name)); 
			authorsText.append("\n\n"); 
			for (Contributor contributor : this.mavenProject.getContributors()) {
				authorsText.append(getLString(InstallLicenseMojo.class, "DEVELOPER", 
						contributor.getName(), contributor.getEmail()));
				authorsText.append("\n"); 
			}
			File authorFile = new File(metainfDirectory, filename);
			fileWriter = new FileWriter(authorFile);
			try {
				fileWriter.write(authorsText.toString());
			}
			finally {
				fileWriter.close();
			}
		}
		catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
