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>
|
<groupId>$groupId</groupId>
|
||||||
#end
|
#end
|
||||||
<artifactId>$artifactId</artifactId>
|
<artifactId>$artifactId</artifactId>
|
||||||
#if ($version != "1.0.0")
|
#if ($version != "1.0.1")
|
||||||
<version>$version</version>
|
<version>$version</version>
|
||||||
#end
|
#end
|
||||||
<parent>
|
<parent>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<groupId>${groupId}</groupId>
|
<groupId>${groupId}</groupId>
|
||||||
#end
|
#end
|
||||||
<artifactId>${artifactId}</artifactId>
|
<artifactId>${artifactId}</artifactId>
|
||||||
#if (${version} != "1.0.0")
|
#if (${version} != "1.0.1")
|
||||||
<version>${version}</version>
|
<version>${version}</version>
|
||||||
#end
|
#end
|
||||||
<parent>
|
<parent>
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<groupId>\${groupId}</groupId>
|
<groupId>\${groupId}</groupId>
|
||||||
#end
|
#end
|
||||||
<artifactId>\${artifactId}</artifactId>
|
<artifactId>\${artifactId}</artifactId>
|
||||||
#if (\${version} != "1.0.0")
|
#if (\${version} != "1.0.1")
|
||||||
<version>\${version}</version>
|
<version>\${version}</version>
|
||||||
#end
|
#end
|
||||||
<parent>
|
<parent>
|
||||||
|
|||||||
@ -143,7 +143,7 @@
|
|||||||
<executables>bin/*.sh, bin/wrapper-*</executables>
|
<executables>bin/*.sh, bin/wrapper-*</executables>
|
||||||
<bootstrapClass>com.pmease.commons.bootstrap.Bootstrap</bootstrapClass>
|
<bootstrapClass>com.pmease.commons.bootstrap.Bootstrap</bootstrapClass>
|
||||||
<moduleClass>${package}.PluginModule</moduleClass>
|
<moduleClass>${package}.PluginModule</moduleClass>
|
||||||
<aggregation>false</aggregation>
|
<aggregation>true</aggregation>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@ -156,7 +156,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.pmease</groupId>
|
<groupId>com.pmease</groupId>
|
||||||
<artifactId>plugin.maven</artifactId>
|
<artifactId>plugin.maven</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>check-project-dependencies</id>
|
<id>check-project-dependencies</id>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<groupId>com.pmease</groupId>
|
<groupId>com.pmease</groupId>
|
||||||
<artifactId>plugin.maven</artifactId>
|
<artifactId>plugin.maven</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.1</version>
|
||||||
<packaging>maven-plugin</packaging>
|
<packaging>maven-plugin</packaging>
|
||||||
|
|
||||||
<prerequisites>
|
<prerequisites>
|
||||||
|
|||||||
@ -74,9 +74,21 @@ public class CheckProjectDependenciesMojo extends AbstractMojo {
|
|||||||
dependencyKeys.add(artifact.getGroupId() + "." + artifact.getArtifactId());
|
dependencyKeys.add(artifact.getGroupId() + "." + artifact.getArtifactId());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Map.Entry<String, String> entry : projectVersions.entrySet()) {
|
Set<String> pluginKeys = new HashSet<String>();
|
||||||
if (!dependencyKeys.contains(entry.getKey()))
|
for (File projectDir : workspaceDir.listFiles()) {
|
||||||
errors.add("Missed dependency to project '" + entry.getKey() + "'.");
|
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>>();
|
Map<String, Set<String>> artifactVersions = new HashMap<String, Set<String>>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user