Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor JKubeProjectUtil.getFinalOutputArtifact to directly make use of jkubeProject.getArtifact() #817

Open
rohanKanojia opened this issue Aug 2, 2021 · 0 comments

Comments

@rohanKanojia
Copy link
Member

Description

Info

Right now in JKubeProjectUtil.getFinalOutputArtifact() method we're trying to infer final output artifact(final jar) in a bit hacky-ish way:
https://github.com/eclipse/jkube/blob/cff79a222dcf8909ddd124f37437c9acee46721a/jkube-kit/common/src/main/java/org/eclipse/jkube/kit/common/util/JKubeProjectUtil.java#L118-L129

We can simplify this to use jkubeProject.getArtifact() directly. But this doesn't work very well with maven. In case of maven, the value present in mavenProject.getArtifact().getFile() depends on the maven phase the goal was executed. Take this example:

mvn k8s:build mavenProject.getArtifact().getFile() = null
mvn compile k8s:build mavenProject.getArtifact().getFile() = ${project.baseDir}/target/classes
mvn package k8s:build mavenProject.getArtifact().getFile() = ${project.baseDir}/target/projectname-version.jar

We need to find a way to smartly handle all these scenarios so that JKubeProject gets initialized with correct artifact file in MavenUtil.convertMavenProjectToJKubeProject. Right now we're managing with just a workaround which checks for artifact when manual inferring doesn't return correct artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant