mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
maven: ejb-client artifacts building fix
This commit is contained in:
+21
-2
@@ -25,9 +25,11 @@ import org.jetbrains.jps.maven.model.JpsMavenExtensionService;
|
||||
import org.jetbrains.jps.maven.model.impl.MavenEjbClientConfiguration;
|
||||
import org.jetbrains.jps.maven.model.impl.MavenProjectConfiguration;
|
||||
import org.jetbrains.jps.maven.model.impl.MavenResourceFileFilter;
|
||||
import org.jetbrains.jps.model.JpsElement;
|
||||
import org.jetbrains.jps.model.JpsModel;
|
||||
import org.jetbrains.jps.model.artifact.JpsArtifact;
|
||||
import org.jetbrains.jps.model.artifact.elements.JpsPackagingElement;
|
||||
import org.jetbrains.jps.model.ex.JpsElementBase;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -47,8 +49,25 @@ public class MavenEjbArtifactRootCopyingHandlerProvider extends ArtifactRootCopy
|
||||
if (projectConfiguration == null) return null;
|
||||
|
||||
MavenEjbClientConfiguration ejbCfg = projectConfiguration.ejbClientArtifactConfigs.get(artifact.getName());
|
||||
if (ejbCfg == null) return null;
|
||||
if (ejbCfg == null) {
|
||||
JpsArtifact parentArtifact = findParentArtifact(contextElement);
|
||||
if (parentArtifact != null) {
|
||||
ejbCfg = projectConfiguration.ejbClientArtifactConfigs.get(parentArtifact.getName());
|
||||
}
|
||||
}
|
||||
return ejbCfg == null ? null : new FilterCopyHandler(new MavenResourceFileFilter(root, ejbCfg));
|
||||
}
|
||||
|
||||
return new FilterCopyHandler(new MavenResourceFileFilter(root, ejbCfg));
|
||||
private static JpsArtifact findParentArtifact(JpsElement element) {
|
||||
if (element instanceof JpsElementBase) {
|
||||
JpsElementBase parent = ((JpsElementBase)element).getParent();
|
||||
if (parent instanceof JpsArtifact) {
|
||||
return (JpsArtifact)parent;
|
||||
}
|
||||
if (parent != null) {
|
||||
return findParentArtifact(parent);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -395,8 +395,6 @@ public class MavenResourceCompilerConfigurationGenerator {
|
||||
return;
|
||||
}
|
||||
|
||||
String ejbClientArtifactName = MavenUtil.getEjbClientArtifactName(module);
|
||||
|
||||
MavenEjbClientConfiguration ejbClientCfg = new MavenEjbClientConfiguration();
|
||||
|
||||
Element includes = pluginCfg.getChild("clientIncludes");
|
||||
@@ -420,7 +418,7 @@ public class MavenResourceCompilerConfigurationGenerator {
|
||||
}
|
||||
|
||||
if (!ejbClientCfg.isEmpty()) {
|
||||
projectCfg.ejbClientArtifactConfigs.put(ejbClientArtifactName, ejbClientCfg);
|
||||
projectCfg.ejbClientArtifactConfigs.put(MavenUtil.getEjbClientArtifactName(module, true), ejbClientCfg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -933,8 +933,8 @@ public class MavenUtil {
|
||||
return module.getName() + ":" + packaging + (exploded ? " exploded" : "");
|
||||
}
|
||||
|
||||
public static String getEjbClientArtifactName(Module module) {
|
||||
return module.getName() + ":ejb-client";
|
||||
public static String getEjbClientArtifactName(Module module, boolean exploded) {
|
||||
return module.getName() + ":ejb-client" + (exploded ? " exploded" : "");
|
||||
}
|
||||
|
||||
public static String getIdeaVersionToPassToMavenProcess() {
|
||||
|
||||
Reference in New Issue
Block a user