• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 18106137833

29 Sep 2025 06:00PM UTC coverage: 68.465% (-0.003%) from 68.468%
18106137833

push

github

web-flow
#1515: fix snapshot upgrade (#1516)

3438 of 5499 branches covered (62.52%)

Branch coverage included in aggregate %.

8989 of 12652 relevant lines covered (71.05%)

3.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

28.57
cli/src/main/java/com/devonfw/tools/ide/tool/mvn/MvnBasedLocalToolCommandlet.java
1
package com.devonfw.tools.ide.tool.mvn;
2

3
import java.nio.file.Path;
4
import java.util.Set;
5

6
import com.devonfw.tools.ide.common.Tag;
7
import com.devonfw.tools.ide.context.IdeContext;
8
import com.devonfw.tools.ide.tool.LocalToolCommandlet;
9
import com.devonfw.tools.ide.tool.repository.MvnArtifactMetadata;
10
import com.devonfw.tools.ide.tool.repository.MvnRepository;
11
import com.devonfw.tools.ide.tool.repository.ToolRepository;
12
import com.devonfw.tools.ide.version.VersionIdentifier;
13

14
/**
15
 * Extends {@link LocalToolCommandlet} for {@link Mvn Maven} based tools via {@link MvnRepository}.
16
 */
17
public abstract class MvnBasedLocalToolCommandlet extends LocalToolCommandlet {
1✔
18

19
  private final MvnArtifact artifact;
20

21
  /**
22
   * @param context the {@link IdeContext}.
23
   * @param tool the {@link #getName() tool name}.
24
   * @param artifact the {@link MvnArtifact}.
25
   * @param tags the {@link #getTags() tags}.
26
   */
27
  public MvnBasedLocalToolCommandlet(IdeContext context, String tool, MvnArtifact artifact, Set<Tag> tags) {
28

29
    super(context, tool, tags);
5✔
30
    this.artifact = artifact;
3✔
31
  }
1✔
32

33
  /**
34
   * @param edition the {@link #getConfiguredEdition() tool edition}. May be ignored.
35
   * @return the {@link MvnArtifact}.
36
   */
37
  public MvnArtifact getArtifact(String edition) {
38

39
    assert (edition.equals(this.tool));
×
40
    return this.artifact;
×
41
  }
42

43
  @Override
44
  public ToolRepository getToolRepository() {
45

46
    return this.context.getMvnRepository();
×
47
  }
48

49
  @Override
50
  protected Path downloadTool(String edition, ToolRepository toolRepository, VersionIdentifier resolvedVersion) {
51

52
    MvnRepository mvnRepository = this.context.getMvnRepository();
×
53
    MvnArtifact mavenArtifact = getArtifact(edition);
×
54
    mavenArtifact = mavenArtifact.withVersion(resolvedVersion.toString());
×
55
    MvnArtifactMetadata mavenArtifactMetadata = mvnRepository.getMetadata(mavenArtifact, this.tool, edition);
×
56
    return mvnRepository.download(mavenArtifactMetadata);
×
57
  }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc