Search in sources :

Example 1 with MavenWorkspaceCache

use of org.eclipse.che.maven.data.MavenWorkspaceCache in project che by eclipse.

the class CheArtifactResolver method isModule.

private boolean isModule(Artifact artifact) {
    MavenWorkspaceCache cache = workspaceCache;
    if (cache == null) {
        return false;
    }
    Entry entry = cache.findEntry(new MavenKey(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()));
    if (entry == null) {
        return false;
    }
    artifact.setResolved(true);
    artifact.setFile(entry.getFile(artifact.getType()));
    artifact.selectVersion(entry.getKey().getVersion());
    return true;
}
Also used : MavenWorkspaceCache(org.eclipse.che.maven.data.MavenWorkspaceCache) MavenKey(org.eclipse.che.maven.data.MavenKey) Entry(org.eclipse.che.maven.data.MavenWorkspaceCache.Entry)

Example 2 with MavenWorkspaceCache

use of org.eclipse.che.maven.data.MavenWorkspaceCache in project che by eclipse.

the class MavenServerManagerTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    workspaceCache = new MavenWorkspaceCache();
    workspaceCache.put(new MavenKey("org.eclipse.che", "che-ide-subModule", "1.0.0-TEST-SNAPSHOT"), new File(MavenServerManagerTest.class.getResource("/multimoduleProject/subModule/pom.xml").getFile()));
    mavenServer = manager.createMavenServer();
    mavenServer.customize(workspaceCache, new MyMavenTerminal(), new MyMavenServerProgressNotifier(), true, false);
}
Also used : MavenWorkspaceCache(org.eclipse.che.maven.data.MavenWorkspaceCache) MavenKey(org.eclipse.che.maven.data.MavenKey) File(java.io.File) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

MavenKey (org.eclipse.che.maven.data.MavenKey)2 MavenWorkspaceCache (org.eclipse.che.maven.data.MavenWorkspaceCache)2 File (java.io.File)1 Entry (org.eclipse.che.maven.data.MavenWorkspaceCache.Entry)1 BeforeMethod (org.testng.annotations.BeforeMethod)1