Search in sources :

Example 1 with MavenProjectConfiguration

use of org.jetbrains.jps.maven.model.impl.MavenProjectConfiguration in project intellij-community by JetBrains.

the class MavenEjbArtifactRootCopyingHandlerProvider method createCustomHandler.

@Nullable
@Override
public FileCopyingHandler createCustomHandler(@NotNull JpsArtifact artifact, @NotNull File root, @NotNull JpsPackagingElement contextElement, @NotNull JpsModel model, @NotNull BuildDataPaths buildDataPaths) {
    MavenProjectConfiguration projectConfiguration = JpsMavenExtensionService.getInstance().getMavenProjectConfiguration(buildDataPaths);
    if (projectConfiguration == null)
        return null;
    MavenEjbClientConfiguration ejbCfg = projectConfiguration.ejbClientArtifactConfigs.get(artifact.getName());
    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));
}
Also used : MavenProjectConfiguration(org.jetbrains.jps.maven.model.impl.MavenProjectConfiguration) MavenResourceFileFilter(org.jetbrains.jps.maven.model.impl.MavenResourceFileFilter) FilterCopyHandler(org.jetbrains.jps.incremental.artifacts.instructions.FilterCopyHandler) JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact) MavenEjbClientConfiguration(org.jetbrains.jps.maven.model.impl.MavenEjbClientConfiguration) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with MavenProjectConfiguration

use of org.jetbrains.jps.maven.model.impl.MavenProjectConfiguration in project intellij-plugins by JetBrains.

the class OsgiBuildUtil method collectMavenProjectProperties.

private static void collectMavenProjectProperties(CompileContext context, JpsModule module, final Properties result) {
    BuildDataPaths dataPaths = context.getProjectDescriptor().dataManager.getDataPaths();
    MavenProjectConfiguration projectConfig = JpsMavenExtensionService.getInstance().getMavenProjectConfiguration(dataPaths);
    if (projectConfig != null) {
        JpsJavaExtensionService.dependencies(module).recursively().productionOnly().processModules(module1 -> {
            MavenModuleResourceConfiguration moduleConfig = projectConfig.moduleConfigurations.get(module1.getName());
            if (moduleConfig != null) {
                for (Map.Entry<String, String> entry : moduleConfig.properties.entrySet()) {
                    result.setProperty(entry.getKey(), entry.getValue());
                }
            }
        });
    }
}
Also used : MavenProjectConfiguration(org.jetbrains.jps.maven.model.impl.MavenProjectConfiguration) BuildDataPaths(org.jetbrains.jps.builders.storage.BuildDataPaths) MavenModuleResourceConfiguration(org.jetbrains.jps.maven.model.impl.MavenModuleResourceConfiguration) Map(java.util.Map)

Example 3 with MavenProjectConfiguration

use of org.jetbrains.jps.maven.model.impl.MavenProjectConfiguration in project intellij-plugins by JetBrains.

the class OsgiBuildUtil method findMavenProjectPath.

private static File findMavenProjectPath(CompileContext context, JpsModule module) {
    BuildDataPaths dataPaths = context.getProjectDescriptor().dataManager.getDataPaths();
    MavenProjectConfiguration projectConfig = JpsMavenExtensionService.getInstance().getMavenProjectConfiguration(dataPaths);
    if (projectConfig != null) {
        MavenModuleResourceConfiguration moduleConfig = projectConfig.moduleConfigurations.get(module.getName());
        if (moduleConfig != null) {
            return new File(FileUtil.toSystemDependentName(moduleConfig.directory), "pom.xml");
        }
    }
    return null;
}
Also used : MavenProjectConfiguration(org.jetbrains.jps.maven.model.impl.MavenProjectConfiguration) BuildDataPaths(org.jetbrains.jps.builders.storage.BuildDataPaths) MavenModuleResourceConfiguration(org.jetbrains.jps.maven.model.impl.MavenModuleResourceConfiguration) File(java.io.File)

Aggregations

MavenProjectConfiguration (org.jetbrains.jps.maven.model.impl.MavenProjectConfiguration)3 BuildDataPaths (org.jetbrains.jps.builders.storage.BuildDataPaths)2 MavenModuleResourceConfiguration (org.jetbrains.jps.maven.model.impl.MavenModuleResourceConfiguration)2 File (java.io.File)1 Map (java.util.Map)1 Nullable (org.jetbrains.annotations.Nullable)1 FilterCopyHandler (org.jetbrains.jps.incremental.artifacts.instructions.FilterCopyHandler)1 MavenEjbClientConfiguration (org.jetbrains.jps.maven.model.impl.MavenEjbClientConfiguration)1 MavenResourceFileFilter (org.jetbrains.jps.maven.model.impl.MavenResourceFileFilter)1 JpsArtifact (org.jetbrains.jps.model.artifact.JpsArtifact)1