mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-116921 Run configuration can't resolve test dependency when "Resolve workspace artifacts" ticked on.
This commit is contained in:
+4
@@ -56,6 +56,10 @@ public class MavenModuleMap {
|
||||
|
||||
public boolean resolveToModule(Artifact artifact) {
|
||||
String extension = artifact.getArtifactHandler().getExtension();
|
||||
if ("jar".equals(extension) && "test-jar".equals(artifact.getType())) {
|
||||
extension = "test-jar";
|
||||
}
|
||||
|
||||
File file = findArtifact(artifact.getGroupId(), artifact.getArtifactId(), extension, artifact.getBaseVersion());
|
||||
|
||||
if(file == null) {
|
||||
|
||||
+6
-1
@@ -52,7 +52,12 @@ public class MyWorkspaceReader implements WorkspaceReader {
|
||||
}
|
||||
|
||||
public File findArtifact(Artifact artifact) {
|
||||
return MavenModuleMap.getInstance().findArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(),
|
||||
String type = artifact.getExtension();
|
||||
if ("jar".equals(type) && "tests".equals(artifact.getClassifier())) {
|
||||
type = "test-jar";
|
||||
}
|
||||
|
||||
return MavenModuleMap.getInstance().findArtifact(artifact.getGroupId(), artifact.getArtifactId(), type,
|
||||
artifact.getBaseVersion());
|
||||
}
|
||||
|
||||
|
||||
+6
-1
@@ -52,7 +52,12 @@ public class IntelliJWorkspaceReaderM31 implements WorkspaceReader {
|
||||
}
|
||||
|
||||
public File findArtifact(Artifact artifact) {
|
||||
return MavenModuleMap.getInstance().findArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(),
|
||||
String type = artifact.getExtension();
|
||||
if ("jar".equals(type) && "tests".equals(artifact.getClassifier())) {
|
||||
type = "test-jar";
|
||||
}
|
||||
|
||||
return MavenModuleMap.getInstance().findArtifact(artifact.getGroupId(), artifact.getArtifactId(), type,
|
||||
artifact.getBaseVersion());
|
||||
}
|
||||
|
||||
|
||||
+6
@@ -260,6 +260,12 @@ public class MavenExternalParameters {
|
||||
+ ':' + mavenProject.getMavenId().getVersion(),
|
||||
mavenProject.getFile().getPath());
|
||||
|
||||
res.setProperty(mavenProject.getMavenId().getGroupId()
|
||||
+ ':' + mavenProject.getMavenId().getArtifactId()
|
||||
+ ":test-jar"
|
||||
+ ':' + mavenProject.getMavenId().getVersion(),
|
||||
mavenProject.getTestOutputDirectory());
|
||||
|
||||
res.setProperty(mavenProject.getMavenId().getGroupId()
|
||||
+ ':' + mavenProject.getMavenId().getArtifactId()
|
||||
+ ':' + mavenProject.getPackaging()
|
||||
|
||||
Reference in New Issue
Block a user