use of org.eclipse.jkube.kit.common.JavaProject in project jkube by eclipse.
the class MavenIssueManagementEnricher method getAnnotations.
private Map<String, String> getAnnotations() {
Map<String, String> annotations = new HashMap<>();
if (getContext() instanceof JKubeEnricherContext) {
JKubeEnricherContext jkubeEnricherContext = (JKubeEnricherContext) getContext();
JavaProject rootProject = jkubeEnricherContext.getProject();
if (hasIssueManagement(rootProject)) {
String system = rootProject.getIssueManagementSystem();
String url = rootProject.getIssueManagementUrl();
if (StringUtils.isNotEmpty(system) && StringUtils.isNotEmpty(url)) {
annotations.put(JKubeAnnotations.ISSUE_SYSTEM.value(), system);
annotations.put(JKubeAnnotations.ISSUE_TRACKER_URL.value(), url);
}
}
}
return annotations;
}
use of org.eclipse.jkube.kit.common.JavaProject in project jkube by eclipse.
the class MavenScmEnricher method getAnnotations.
private Map<String, String> getAnnotations() {
Map<String, String> annotations = new HashMap<>();
if (getContext() instanceof JKubeEnricherContext) {
JKubeEnricherContext jkubeEnricherContext = (JKubeEnricherContext) getContext();
JavaProject rootProject = jkubeEnricherContext.getProject();
if (hasScm(rootProject)) {
String url = rootProject.getScmUrl();
String tag = rootProject.getScmTag();
if (StringUtils.isNotEmpty(tag)) {
annotations.put(JKubeAnnotations.SCM_TAG.value(), tag);
}
if (StringUtils.isNotEmpty(url)) {
annotations.put(JKubeAnnotations.SCM_URL.value(), url);
}
}
}
return annotations;
}
use of org.eclipse.jkube.kit.common.JavaProject in project jkube by eclipse.
the class AssemblyConfigurationSourceTest method testReactorProjects.
@Test
public void testReactorProjects() {
JavaProject project1 = JavaProject.builder().build();
JavaProject project2 = JavaProject.builder().build();
JKubeConfiguration buildContext = JKubeConfiguration.builder().sourceDirectory("/src/docker").outputDirectory("/output/docker").reactorProjects(Arrays.asList(project1, project2)).build();
AssemblyConfigurationSource source = new AssemblyConfigurationSource(buildContext, null, null);
assertEquals(2, source.getReactorProjects().size());
}
use of org.eclipse.jkube.kit.common.JavaProject in project jkube by eclipse.
the class AssemblyManagerTest method testEnsureThatArtifactFileIsSetWithProjectArtifactSet.
@Test
public void testEnsureThatArtifactFileIsSetWithProjectArtifactSet() throws IOException {
// Given
JavaProject project = JavaProject.builder().artifact(temporaryFolder.newFile("temp-project-0.0.1.jar")).build();
// When
final File artifactFile = assemblyManager.ensureThatArtifactFileIsSet(project);
// Then
assertThat(artifactFile).isFile().exists().hasName("temp-project-0.0.1.jar");
}
use of org.eclipse.jkube.kit.common.JavaProject in project jkube by eclipse.
the class AssemblyManagerTest method testEnsureThatArtifactFileIsSetWithNullProjectArtifact.
@Test
public void testEnsureThatArtifactFileIsSetWithNullProjectArtifact() throws IOException {
// Given
assertTrue(new File(targetDirectory, "foo-project-0.0.1.jar").createNewFile());
JavaProject project = JavaProject.builder().buildDirectory(targetDirectory).packaging("jar").buildFinalName("foo-project-0.0.1").build();
// When
final File artifactFile = assemblyManager.ensureThatArtifactFileIsSet(project);
// Then
assertThat(artifactFile).isFile().exists().hasName("foo-project-0.0.1.jar");
}
Aggregations