Search in sources :

Example 21 with MavenProject

use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.

the class InvalidProjectImportingTest method testUnresolvedParent.

public void testUnresolvedParent() throws Exception {
    importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<parent>" + "  <groupId>test</groupId>" + "  <artifactId>parent</artifactId>" + "  <version>1</version>" + "</parent>");
    assertModules("project");
    MavenProject root = getRootProjects().get(0);
    assertProblems(root, "Parent 'test:parent:1' not found");
}
Also used : MavenProject(org.jetbrains.idea.maven.project.MavenProject)

Example 22 with MavenProject

use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.

the class InvalidProjectImportingTest method testUnresolvedPomTypeDependency.

@Bombed(user = "Vladislav.Soroka", year = 2020, month = Calendar.APRIL, day = 1, description = "temporary disabled")
public void testUnresolvedPomTypeDependency() throws Exception {
    createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<dependencies>" + "  <dependency>" + "    <groupId>xxx</groupId>" + "    <artifactId>yyy</artifactId>" + "    <version>4.0</version>" + "    <type>pom</type>" + "  </dependency>" + "</dependencies>");
    importProject();
    assertModuleLibDeps("project");
    MavenProject root = getRootProjects().get(0);
    assertProblems(root, "Unresolved dependency: 'xxx:yyy:pom:4.0'");
}
Also used : MavenProject(org.jetbrains.idea.maven.project.MavenProject) Bombed(com.intellij.idea.Bombed)

Example 23 with MavenProject

use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.

the class InvalidProjectImportingTest method testUnknownProblemWithEmptyFile.

public void testUnknownProblemWithEmptyFile() throws Exception {
    createProjectPom("");
    new WriteAction() {

        @Override
        protected void run(@NotNull Result result) throws Throwable {
            myProjectPom.setBinaryContent(new byte[0]);
        }
    }.execute().throwException();
    importProject();
    assertModules("project");
    MavenProject root = getRootProjects().get(0);
    assertProblems(root, "'pom.xml' has syntax errors");
}
Also used : MavenProject(org.jetbrains.idea.maven.project.MavenProject) WriteAction(com.intellij.openapi.application.WriteAction) NotNull(org.jetbrains.annotations.NotNull) Result(com.intellij.openapi.application.Result)

Example 24 with MavenProject

use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.

the class InvalidProjectImportingTest method testInvalidSettingsXml.

public void testInvalidSettingsXml() throws Exception {
    updateSettingsXml("<localRepo<<");
    importProject("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>");
    assertModules("project");
    MavenProject root = getRootProjects().get(0);
    assertProblems(root, "'settings.xml' has syntax errors");
}
Also used : MavenProject(org.jetbrains.idea.maven.project.MavenProject)

Example 25 with MavenProject

use of org.jetbrains.idea.maven.project.MavenProject in project intellij-community by JetBrains.

the class InvalidProjectImportingTest method testInvalidModuleModel.

public void testInvalidModuleModel() throws Exception {
    createProjectPom("<groupId>test</groupId>" + "<artifactId>project</artifactId>" + "<version>1</version>" + "<packaging>pom</packaging>" + "<modules>" + "  <module>foo</module>" + "</modules>");
    createModulePom("foo", "<groupId>test</groupId>" + "<artifactId>foo</artifactId>" + //  invalid tag
    "<version>1");
    importProject();
    assertModules("project", "foo");
    MavenProject root = getRootProjects().get(0);
    assertProblems(root);
    assertProblems(getModules(root).get(0), "'pom.xml' has syntax errors");
}
Also used : MavenProject(org.jetbrains.idea.maven.project.MavenProject)

Aggregations

MavenProject (org.jetbrains.idea.maven.project.MavenProject)132 VirtualFile (com.intellij.openapi.vfs.VirtualFile)40 MavenProjectsManager (org.jetbrains.idea.maven.project.MavenProjectsManager)20 MavenId (org.jetbrains.idea.maven.model.MavenId)16 Project (com.intellij.openapi.project.Project)10 Nullable (org.jetbrains.annotations.Nullable)9 Bombed (com.intellij.idea.Bombed)8 Module (com.intellij.openapi.module.Module)6 DataContext (com.intellij.openapi.actionSystem.DataContext)5 File (java.io.File)5 ArrayList (java.util.ArrayList)5 Result (com.intellij.openapi.application.Result)4 MavenArtifact (org.jetbrains.idea.maven.model.MavenArtifact)4 MavenEmbeddersManager (org.jetbrains.idea.maven.project.MavenEmbeddersManager)4 WriteCommandAction (com.intellij.openapi.command.WriteCommandAction)3 TextRange (com.intellij.openapi.util.TextRange)3 NotNull (org.jetbrains.annotations.NotNull)3 MavenRunnerParameters (org.jetbrains.idea.maven.execution.MavenRunnerParameters)3 MavenExplicitProfiles (org.jetbrains.idea.maven.model.MavenExplicitProfiles)3 MavenProjectsTree (org.jetbrains.idea.maven.project.MavenProjectsTree)3