Only check missed dependencies on plugin projects.

This commit is contained in:
robin 2012-04-26 10:57:21 +08:00
parent 4b6c98e26e
commit be94392ba5
7 changed files with 21 additions and 9 deletions

View File

@ -5,7 +5,7 @@
<groupId>$groupId</groupId>
#end
<artifactId>$artifactId</artifactId>
#if ($version != "1.0.0")
#if ($version != "1.0.1")
<version>$version</version>
#end
<parent>

View File

@ -5,7 +5,7 @@
<groupId>${groupId}</groupId>
#end
<artifactId>${artifactId}</artifactId>
#if (${version} != "1.0.0")
#if (${version} != "1.0.1")
<version>${version}</version>
#end
<parent>

View File

@ -5,7 +5,7 @@
<groupId>\${groupId}</groupId>
#end
<artifactId>\${artifactId}</artifactId>
#if (\${version} != "1.0.0")
#if (\${version} != "1.0.1")
<version>\${version}</version>
#end
<parent>

View File

@ -143,7 +143,7 @@
<executables>bin/*.sh, bin/wrapper-*</executables>
<bootstrapClass>com.pmease.commons.bootstrap.Bootstrap</bootstrapClass>
<moduleClass>${package}.PluginModule</moduleClass>
<aggregation>false</aggregation>
<aggregation>true</aggregation>
</properties>
</project>

View File

@ -156,7 +156,7 @@
<plugin>
<groupId>com.pmease</groupId>
<artifactId>plugin.maven</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<executions>
<execution>
<id>check-project-dependencies</id>

View File

@ -4,7 +4,7 @@
<groupId>com.pmease</groupId>
<artifactId>plugin.maven</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<packaging>maven-plugin</packaging>
<prerequisites>

View File

@ -74,9 +74,21 @@ public class CheckProjectDependenciesMojo extends AbstractMojo {
dependencyKeys.add(artifact.getGroupId() + "." + artifact.getArtifactId());
}
for (Map.Entry<String, String> entry : projectVersions.entrySet()) {
if (!dependencyKeys.contains(entry.getKey()))
errors.add("Missed dependency to project '" + entry.getKey() + "'.");
Set<String> pluginKeys = new HashSet<String>();
for (File projectDir : workspaceDir.listFiles()) {
if (!projectDir.equals(project.getBasedir())) {
File propsFile = new File(projectDir, "target/classes/"
+ PluginConstants.PLUGIN_PROPERTY_FILE);
if (propsFile.exists()) {
Properties props = PluginUtils.loadProperties(propsFile);
pluginKeys.add(props.getProperty("id"));
}
}
}
for (String pluginKey: pluginKeys) {
if (!dependencyKeys.contains(pluginKey))
errors.add("Missed dependency to project '" + pluginKey + "'.");
}
Map<String, Set<String>> artifactVersions = new HashMap<String, Set<String>>();