mirror of
https://github.com/theonedev/onedev.git
synced 2025-12-08 18:26:30 +00:00
Only check missed dependencies on plugin projects.
This commit is contained in:
parent
4b6c98e26e
commit
be94392ba5
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user