use of org.apache.maven.model.Parent in project intellij-community by JetBrains.
the class Maven3AetherModelConverter method convertModelWithAetherDependencyTree.
@NotNull
public static MavenModel convertModelWithAetherDependencyTree(Model model, List<String> sources, List<String> testSources, Collection<Artifact> dependencies, Collection<DependencyNode> dependencyTree, Collection<Artifact> extensions, File localRepository) throws RemoteException {
MavenModel result = new MavenModel();
result.setMavenId(new MavenId(model.getGroupId(), model.getArtifactId(), model.getVersion()));
Parent parent = model.getParent();
if (parent != null) {
result.setParent(new MavenParent(new MavenId(parent.getGroupId(), parent.getArtifactId(), parent.getVersion()), parent.getRelativePath()));
}
result.setPackaging(model.getPackaging());
result.setName(model.getName());
result.setProperties(model.getProperties() == null ? new Properties() : model.getProperties());
result.setPlugins(convertPlugins(model));
Map<Artifact, MavenArtifact> convertedArtifacts = new THashMap<Artifact, MavenArtifact>();
result.setExtensions(convertArtifacts(extensions, convertedArtifacts, localRepository));
result.setDependencyTree(convertAetherDependencyNodes(null, dependencyTree, convertedArtifacts, localRepository));
result.setDependencies(convertArtifacts(dependencies, convertedArtifacts, localRepository));
result.setRemoteRepositories(convertRepositories(model.getRepositories()));
result.setProfiles(convertProfiles(model.getProfiles()));
result.setModules(model.getModules());
convertBuild(result.getBuild(), model.getBuild(), sources, testSources);
return result;
}
use of org.apache.maven.model.Parent in project maven-plugins by apache.
the class InstallMojo method copyParentPoms.
/**
* Installs all parent POMs of the specified POM file that are available in the local repository.
*
* @param pomFile The path to the POM file whose parents should be installed, must not be <code>null</code>.
* @throws MojoExecutionException If any (existing) parent POM could not be installed.
*/
private void copyParentPoms(File pomFile) throws MojoExecutionException {
Model model = PomUtils.loadPom(pomFile);
Parent parent = model.getParent();
if (parent != null) {
copyParentPoms(parent.getGroupId(), parent.getArtifactId(), parent.getVersion());
}
}
use of org.apache.maven.model.Parent in project maven-plugins by apache.
the class DeployFileMojoUnitTest method setUp.
public void setUp() {
Model pomModel = new Model();
pomModel.setPackaging(null);
parent = new Parent();
parent.setGroupId("parentGroup");
parent.setArtifactId("parentArtifact");
parent.setVersion("parentVersion");
mojo = new MockDeployFileMojo(pomModel);
}
Aggregations