Package org.jfrog.build.api.builder

Examples of org.jfrog.build.api.builder.ArtifactBuilder


                " using file " + file, Project.MSG_INFO);

        if (isArtifactExist(module.getArtifacts(), name) || isArtifactExist(module.getExcludedArtifacts(), name)) {
            return;
        }
        ArtifactBuilder artifactBuilder = new ArtifactBuilder(name);
        artifactBuilder.type(type);

        File artifactFile = new File(file);
        Map<String, String> checksums = calculateFileChecksum(artifactFile);
        String md5 = checksums.get(MD5);
        String sha1 = checksums.get(SHA1);
        artifactBuilder.md5(md5).sha1(sha1);
        Artifact artifact = artifactBuilder.build();
        if (excludeArtifactsFromBuild && PatternMatcher.pathConflicts(fullPath, patterns)) {
            module.getExcludedArtifacts().add(artifact);
        } else {
            module.getArtifacts().add(artifact);
        }
View Full Code Here


            String artifactExtension = moduleArtifact.getArtifactHandler().getExtension();
            String type = getTypeString(moduleArtifact.getType(), artifactClassifier, artifactExtension);

            String artifactName = getArtifactName(artifactId, artifactVersion, artifactClassifier, artifactExtension);

            ArtifactBuilder artifactBuilder = new ArtifactBuilder(artifactName).type(type);
            File artifactFile = moduleArtifact.getFile();
            // for pom projects take the file from the project if the artifact file is null
            if (isPomProject(moduleArtifact) && moduleArtifact.equals(project.getArtifact())) {
                artifactFile = project.getFile();   // project.getFile() returns the project pom file
            }
            org.jfrog.build.api.Artifact artifact = artifactBuilder.build();
            String groupId = moduleArtifact.getGroupId();
            String deploymentPath = getDeploymentPath(groupId, artifactId, artifactVersion, artifactClassifier, artifactExtension);
            // If excludeArtifactsFromBuild and the PatternMatcher found conflict, add the excluded artifact to the excluded artifact set.
            if (excludeArtifactsFromBuild && PatternMatcher.pathConflicts(deploymentPath, patterns)) {
                module.addExcludedArtifact(artifact);
            } else {
                module.addArtifact(artifact);
            }
            if (isPublishArtifacts(artifactFile)) {
                addDeployableArtifact(artifact, artifactFile, moduleArtifact.getGroupId(),
                        artifactId, artifactVersion, artifactClassifier, artifactExtension);
            }

            /*
            * In case of non packaging Pom project module, we need to create the pom file from the ProjectArtifactMetadata on the Artifact
            */
            if (!isPomProject(moduleArtifact)) {
                for (ArtifactMetadata metadata : moduleArtifact.getMetadataList()) {
                    if (metadata instanceof ProjectArtifactMetadata) {  // the pom metadata
                        File pomFile = ((ProjectArtifactMetadata) metadata).getFile();
                        artifactBuilder.type("pom");
                        String pomFileName = StringUtils.removeEnd(artifactName, artifactExtension) + "pom";
                        artifactBuilder.name(pomFileName);
                        org.jfrog.build.api.Artifact pomArtifact = artifactBuilder.build();
                        deploymentPath = getDeploymentPath(groupId, artifactId, artifactVersion, artifactClassifier, "pom");
                        if (excludeArtifactsFromBuild && PatternMatcher.pathConflicts(deploymentPath, patterns)) {
                            module.addExcludedArtifact(pomArtifact);
                        } else {
                            module.addArtifact(pomArtifact);
View Full Code Here

TOP

Related Classes of org.jfrog.build.api.builder.ArtifactBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.