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

Unreachable statement #88

Closed
manusa opened this issue Mar 3, 2020 · 1 comment · Fixed by #126
Closed

Unreachable statement #88

manusa opened this issue Mar 3, 2020 · 1 comment · Fixed by #126
Assignees
Labels
bug Something isn't working

Comments

@manusa manusa added the bug Something isn't working label Mar 3, 2020
@rohanKanojia
Copy link
Member

Umm, I replaced maven specific Artifact with a File class. If you see this in Docker Maven Plugin source:

https://github.com/fabric8io/docker-maven-plugin/blob/master/src/main/java/io/fabric8/maven/docker/assembly/DockerAssemblyManager.java#L494

    private File ensureThatArtifactFileIsSet(MavenProject project) {
        Artifact artifact = project.getArtifact();
        if (artifact == null) {
            return null;
        }
        File oldFile = artifact.getFile();
        if (oldFile != null) {
            return oldFile;
        }
        Build build = project.getBuild();
        if (build == null) {
            return null;
        }
        String finalName = build.getFinalName();
        String target = build.getDirectory();
        if (finalName == null || target == null) {
            return null;
        }
        File artifactFile = new File(target, finalName + "." + project.getPackaging());
        if (artifactFile.exists() && artifactFile.isFile()) {
            setArtifactFile(project, artifactFile);
        }
        return null;
    }

I think we should remove this artifact assignment and assign project.getArtifact() directly to oldFile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants