use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.
the class MavenProjectNamer method allGroupsEqual.
private static boolean allGroupsEqual(Collection<MavenProject> mavenProjects) {
Iterator<MavenProject> itr = mavenProjects.iterator();
if (!itr.hasNext())
return true;
String groupId = itr.next().getMavenId().getGroupId();
while (itr.hasNext()) {
MavenProject mavenProject = itr.next();
if (!Comparing.equal(groupId, mavenProject.getMavenId().getGroupId())) {
return false;
}
}
return true;
}
use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.
the class ArtifactsDownloadingTest method testDownloadingSpecificDependency.
public void testDownloadingSpecificDependency() throws Exception {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<dependencies>" + " <dependency>" + " <groupId>jmock</groupId>" + " <artifactId>jmock</artifactId>" + " <version>1.2.0</version>" + " </dependency>" + " <dependency>" + " <groupId>junit</groupId>" + " <artifactId>junit</artifactId>" + " <version>4.0</version>" + " </dependency>" + "</dependencies>");
File sources = new File(getRepositoryPath(), "/jmock/jmock/1.2.0/jmock-1.2.0-sources.jar");
File javadoc = new File(getRepositoryPath(), "/jmock/jmock/1.2.0/jmock-1.2.0-javadoc.jar");
assertFalse(sources.exists());
assertFalse(javadoc.exists());
MavenProject project = myProjectsTree.getRootProjects().get(0);
MavenArtifact dep = project.getDependencies().get(0);
downloadArtifacts(Arrays.asList(project), Arrays.asList(dep));
assertTrue(sources.exists());
assertTrue(javadoc.exists());
assertFalse(new File(getRepositoryPath(), "/junit/junit/4.0/junit-4.0-sources.jar").exists());
assertFalse(new File(getRepositoryPath(), "/junit/junit/4.0/junit-4.0-javadoc.jar").exists());
}
use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.
the class ArtifactsDownloadingTest method testReturningNotFoundArtifacts.
public void testReturningNotFoundArtifacts() throws Exception {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<dependencies>" + " <dependency>" + " <groupId>lib</groupId>" + " <artifactId>xxx</artifactId>" + " <version>1</version>" + " </dependency>" + " <dependency>" + " <groupId>junit</groupId>" + " <artifactId>junit</artifactId>" + " <version>4.0</version>" + " </dependency>" + "</dependencies>");
MavenProject project = myProjectsTree.getRootProjects().get(0);
MavenArtifactDownloader.DownloadResult unresolvedArtifacts = downloadArtifacts(Arrays.asList(project), null);
assertUnorderedElementsAreEqual(unresolvedArtifacts.resolvedSources, new MavenId("junit", "junit", "4.0"));
assertUnorderedElementsAreEqual(unresolvedArtifacts.resolvedDocs, new MavenId("junit", "junit", "4.0"));
assertUnorderedElementsAreEqual(unresolvedArtifacts.unresolvedSources, new MavenId("lib", "xxx", "1"));
assertUnorderedElementsAreEqual(unresolvedArtifacts.unresolvedDocs, new MavenId("lib", "xxx", "1"));
}
use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.
the class InvalidProjectImportingTest method testUnresolvedExtensionsAfterImport.
@Bombed(user = "Vladislav.Soroka", year = 2020, month = Calendar.APRIL, day = 1, description = "temporary disabled")
public void testUnresolvedExtensionsAfterImport() throws Exception {
importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<build>" + " <extensions>" + " <extension>" + " <groupId>xxx</groupId>" + " <artifactId>yyy</artifactId>" + " <version>1</version>" + " </extension>" + " </extensions>" + "</build>");
MavenProject root = getRootProjects().get(0);
assertProblems(root, "Unresolved build extension: 'xxx:yyy:1'");
}
use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.
the class DependenciesImportingTest method testInterModuleDependenciesWithLatestVersionAreBeingSetupForSnapshots.
public void testInterModuleDependenciesWithLatestVersionAreBeingSetupForSnapshots() throws Exception {
createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<packaging>pom</packaging>" + "<version>1</version>" + "<modules>" + " <module>m1</module>" + " <module>m2</module>" + "</modules>");
createModulePom("m1", "<groupId>test</groupId>" + "<artifactId>m1</artifactId>" + "<version>1</version>" + "<dependencies>" + " <dependency>" + " <groupId>test</groupId>" + " <artifactId>m2</artifactId>" + " <version>LATEST</version>" + " </dependency>" + "</dependencies>");
createModulePom("m2", "<groupId>test</groupId>" + "<artifactId>m2</artifactId>" + "<version>1-SNAPSHOT</version>");
importProject();
assertModules("project", "m1", "m2");
assertModuleModuleDeps("m1", "m2");
assertModuleLibDeps("m1");
MavenProject p = myProjectsTree.findProject(new MavenId("test", "m1", "1"));
assertEquals(new MavenId("test", "m2", "1-SNAPSHOT"), p.getDependencies().get(0).getMavenId());
}
Aggregations