public void publishArtifacts(List<ArtifactPlan> artifactPlans, EnvironmentVariableContext environmentVariableContext) {
        final File pluggableArtifactFolder = publishPluggableArtifacts(artifactPlans, environmentVariableContext);
        try {
            final List<ArtifactPlan> mergedPlans = artifactPlanFilter.getBuiltInMergedArtifactPlans(artifactPlans);

            if (isMetadataFolderEmpty(pluggableArtifactFolder)) {
                LOGGER.info("Pluggable metadata folder is empty.");
            } else if (pluggableArtifactFolder != null) {
                mergedPlans.add(0, new ArtifactPlan(ArtifactPlanType.file, format("%s%s*", pluggableArtifactFolder.getName(), File.separator), PLUGGABLE_ARTIFACT_METADATA_FOLDER));
            }

            for (ArtifactPlan artifactPlan : mergedPlans) {
                try {
                    artifactPlan.publishBuiltInArtifacts(goPublisher, workingDirectory);
                } catch (Exception e) {
                    failedArtifact.add(artifactPlan);
                }
            }

            if (!failedArtifact.isEmpty()) {
                StringBuilder builder = new StringBuilder();
                for (ArtifactPlan artifactPlan : failedArtifact) {
                    artifactPlan.printArtifactInfo(builder);
                }
                throw new RuntimeException(format("[%s] Uploading finished. Failed to upload %s.", PRODUCT_NAME, builder));
            }
        } finally {
            FileUtils.deleteQuietly(pluggableArtifactFolder);
        }
    }
@Test
    public void shouldUploadFilesWhichMatchedWildCard() throws Exception {
        List<ArtifactPlan> artifactPlans = new ArrayList<>();
        final File src1 = TestFileUtil.createTestFolder(workingFolder, "src1");
        final File testFile1 = TestFileUtil.createTestFile(src1, "test1.txt");
        final File testFile2 = TestFileUtil.createTestFile(src1, "test2.txt");
        final File testFile3 = TestFileUtil.createTestFile(src1, "readme.pdf");
        artifactPlans.add(new ArtifactPlan(ArtifactPlanType.file, src1.getName() + "/*", "dest"));

        artifactsPublisher.publishArtifacts(artifactPlans, env);

        assertThat(publisher.publishedFiles()).containsExactlyInAnyOrderEntriesOf(Map.of(testFile1, "dest", testFile2, "dest", testFile3, "dest"));
    }