You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by James Klo <ji...@sri.com> on 2017/09/19 21:57:03 UTC

how can I prevent maven-deploy-plugin:deploy-file from deploying main artifact?

I’m using the io.fabric8:maven-docker-plugin to launch a container, run specialized build that generates some versioned files and then I want to take those files convert them into an artifact and upload them to our corp Artifactory.

I’ve got mostly the whole thing working except the last step, deploying to Artifactory.  Yes it deploys, but it deploys too many artifacts.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-deploy-plugin</artifactId>
    <version>2.8.2</version>
    <executions>
        <execution>
            <id>default-deploy</id>
            <phase>none</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
        <execution>
            <id>deploy-artifact</id>
            <phase>deploy</phase>
            <goals>
                <goal>deploy-file</goal>
            </goals>
            <configuration>
                <repositoryId>artifactory</repositoryId>
                <url>https://artifactory.sri.com/artifactory/sunflower-local</url>
                <file>${project.build.directory}/${project.artifactId}-${docker_env.FLORA_VERSION}-pdf.tar.bz2</file>
                <groupId>${project.groupId}</groupId>
                <artifactId>${project.artifactId}</artifactId>
                <version>${docker_env.FLORA_VERSION}</version>
                <classifier>pdf</classifier>
                <packaging>tar.bz2</packaging>
                <uniqueVersion>false</uniqueVersion>
            </configuration>
        </execution>
    </executions>
</plugin>
so I’ve disabled the default-deploy execution, and replacing it with my own deploy-artifact, which runs the deploy-file it deploys both the aux artifact and the main artifact:

[INFO] --- maven-deploy-plugin:2.8.2:deploy-file (deploy-artifact) @ flora2-docs ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=36, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=16, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=36, DefaultDependencyCollector.collectTime=3, DefaultDependencyCollector.transformTime=1}
[DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
[DEBUG]          backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
[DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]          junit:junit:jar:3.8.1:compile
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.apache.maven:maven-model:jar:2.2.1:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:2.2.1:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.15:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG]   Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
[DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with basic configurator -->
[DEBUG]   (f) artifactId = flora2-docs
[DEBUG]   (f) classifier = pdf
[DEBUG]   (f) file = /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/target/flora2-docs-1277-pdf.tar.bz2
[DEBUG]   (f) generatePom = true
[DEBUG]   (f) groupId = com.sri
[DEBUG]   (s) localRepository =       id: local
      url: file:///Users/jklo/.m2/repository/
   layout: default
snapshots: [enabled => true, update => always]
 releases: [enabled => true, update => always]

[DEBUG]   (f) offline = false
[DEBUG]   (f) packaging = tar.bz2
[DEBUG]   (f) project = MavenProject: com.sri:flora2-docs:0.0.1-SNAPSHOT @ /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/pom.xml
[DEBUG]   (f) repositoryId = artifactory
[DEBUG]   (f) repositoryLayout = default
[DEBUG]   (f) retryFailedDeploymentCount = 1
[DEBUG]   (f) uniqueVersion = false
[DEBUG]   (f) updateReleaseInfo = false
[DEBUG]   (f) url = https://artifactory.sri.com/artifactory/sunflower-local
[DEBUG]   (f) version = 1277
[DEBUG] -- end configuration --
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local with username=e27574, password=***
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 (3.3 MB at 2.0 MB/s)
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom (423 B at 3.0 kB/s)
Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml
Downloaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml (369 B at 5.8 kB/s)
[DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/resolver-status.properties
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml (322 B at 2.3 kB/s)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local with username=e27574, password=***
Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml
[DEBUG] Could not find metadata com.sri:flora2-docs:0.0.1-SNAPSHOT/maven-metadata.xml in artifactory (https://artifactory.sri.com/artifactory/sunflower-local)
[DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/0.0.1-SNAPSHOT/resolver-status.properties
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 (3.3 MB at 2.4 MB/s)
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml (636 B at 5.0 kB/s)

Is there some way I can suppress the main artifact from being deployed?

Thanks,

Jim




Re: how can I prevent maven-deploy-plugin:deploy-file from deploying main artifact?

Posted by James Klo <ji...@sri.com>.
Hi Robert,

Thanks for the reply.

On Sep 20, 2017, at 1:05 AM, Robert Scholte <rf...@apache.org>> wrote:

Are you asking the right question?


Not sure. I see three possible questions:
1. How can I change/set the version dynamically during the reactor build?
2. How can I replace the main artifact with a different artifact?
3. How can I prevent the main artifact from deploying?


it seems to me you want to deploy files of this project.

Yes, but I want the version coordinates to reflect the version discovered, not the version provided.

if you want to convert/replace the main artifact, I suggest to use the same filename.


I've tried that. All I end up with is a correctly named file installed in my repo at the wrong version coordinate.

also have a look at http://www.mojohaus.org/build-helper-maven-plugin/attach-artifact-mojo.html

How does this replace the main artifact? It says it only adds artifacts.

deploy-file is never a good solution as part of the build lifecycle, there are often plugins which better match the requirements.

Okay. So what is the right plugin? Why is it never a good solution within the lifecycle? Does it not do what it says?

<snark>
And here lies the rub with maven - nowhere exists a master document that outlines how to use each and locate each of thousands of plugins. Sure one can utilize <insert favorite search engine here> to locate the plugin documentation, only to yield cookie cutter generated docs that highlight use both in pom and cli and rarely describe the intent.
</snark>

This goal is intended to be run from commandline and to upload 3rd party jars.

Yes, that's how I've used it in the past. But why would my use case be any different?
1. I'm technically creating a third-party jar.
2. It mostly doing what I want, I just don't understand why it is still deploying my third-party jar also as the main artifact.



Robert


On Tue, 19 Sep 2017 23:57:03 +0200, James Klo <ji...@sri.com>> wrote:

I’m using the io.fabric8:maven-docker-plugin to launch a container, run specialized build that generates some versioned files and then I want to take those files convert them into an artifact and upload them to our corp Artifactory.

I’ve got mostly the whole thing working except the last step, deploying to Artifactory.  Yes it deploys, but it deploys too many artifacts.


<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-deploy-plugin</artifactId>
    <version>2.8.2</version>
    <executions>
        <execution>
            <id>default-deploy</id>
            <phase>none</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
        <execution>
            <id>deploy-artifact</id>
            <phase>deploy</phase>
            <goals>
                <goal>deploy-file</goal>
            </goals>
            <configuration>
                <repositoryId>artifactory</repositoryId>
                <url>https://artifactory.sri.com/artifactory/sunflower-local</url>
                <file>${project.build.directory}/${project.artifactId}-${docker_env.FLORA_VERSION}-pdf.tar.bz2</file>
                <groupId>${project.groupId}</groupId>
                <artifactId>${project.artifactId}</artifactId>
                <version>${docker_env.FLORA_VERSION}</version>
                <classifier>pdf</classifier>
                <packaging>tar.bz2</packaging>
                <uniqueVersion>false</uniqueVersion>
            </configuration>
        </execution>
    </executions>
</plugin>

so I’ve disabled the default-deploy execution, and replacing it with my own deploy-artifact, which runs the deploy-file it deploys both the aux artifact and the main artifact:

[INFO] --- maven-deploy-plugin:2.8.2:deploy-file (deploy-artifact) @ flora2-docs ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=36, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=16, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=36, DefaultDependencyCollector.collectTime=3, DefaultDependencyCollector.transformTime=1}
[DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2:
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
[DEBUG]    org.apache.maven:maven-project:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
[DEBUG]          backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
[DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]          junit:junit:jar:3.8.1:compile
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.apache.maven:maven-model:jar:2.2.1:compile
[DEBUG]    org.apache.maven:maven-artifact:jar:2.2.1:compile
[DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.15:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
[DEBUG]   Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
[DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
[DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
[DEBUG]   Included: junit:junit:jar:3.8.1
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with basic configurator -->
[DEBUG]   (f) artifactId = flora2-docs
[DEBUG]   (f) classifier = pdf
[DEBUG]   (f) file = /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/target/flora2-docs-1277-pdf.tar.bz2
[DEBUG]   (f) generatePom = true
[DEBUG]   (f) groupId = com.sri
[DEBUG]   (s) localRepository =       id: local
      url: file:///Users/jklo/.m2/repository/
   layout: default
snapshots: [enabled => true, update => always]
 releases: [enabled => true, update => always]

[DEBUG]   (f) offline = false
[DEBUG]   (f) packaging = tar.bz2
[DEBUG]   (f) project = MavenProject: com.sri:flora2-docs:0.0.1-SNAPSHOT @ /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/pom.xml
[DEBUG]   (f) repositoryId = artifactory
[DEBUG]   (f) repositoryLayout = default
[DEBUG]   (f) retryFailedDeploymentCount = 1
[DEBUG]   (f) uniqueVersion = false
[DEBUG]   (f) updateReleaseInfo = false
[DEBUG]   (f) url = https://artifactory.sri.com/artifactory/sunflower-local
[DEBUG]   (f) version = 1277
[DEBUG] -- end configuration --
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local with username=e27574, password=***
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 (3.3 MB at 2.0 MB/s)
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom (423 B at 3.0 kB/s)
Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml
Downloaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml (369 B at 5.8 kB/s)
[DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/resolver-status.properties
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml (322 B at 2.3 kB/s)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local with username=e27574, password=***
Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml
[DEBUG] Could not find metadata com.sri:flora2-docs:0.0.1-SNAPSHOT/maven-metadata.xml in artifactory (https://artifactory.sri.com/artifactory/sunflower-local)
[DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/0.0.1-SNAPSHOT/resolver-status.properties
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 (3.3 MB at 2.4 MB/s)
Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml
Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml (636 B at 5.0 kB/s)

Is there some way I can suppress the main artifact from being deployed?

Thanks,

Jim







Re: how can I prevent maven-deploy-plugin:deploy-file from deploying main artifact?

Posted by Robert Scholte <rf...@apache.org>.
Are you asking the right question?

it seems to me you want to deploy files of this project.
if you want to convert/replace the main artifact, I suggest to use the  
same filename.

also have a look at  
http://www.mojohaus.org/build-helper-maven-plugin/attach-artifact-mojo.html

deploy-file is never a good solution as part of the build lifecycle, there  
are often plugins which better match the requirements.
This goal is intended to be run from commandline and to upload 3rd party  
jars.

Robert


On Tue, 19 Sep 2017 23:57:03 +0200, James Klo <ji...@sri.com> wrote:

> I’m using the io.fabric8:maven-docker-plugin to launch a container, run  
> specialized build that generates some versioned files and then I want to  
> >take those files convert them into an artifact and upload them to our  
> corp Artifactory.
>
> I’ve got mostly the whole thing working except the last step, deploying  
> to Artifactory.  Yes it deploys, but it deploys too many artifacts.
>
> <plugin>
>    <groupId>org.apache.maven.plugins</groupId>
>    <artifactId>maven-deploy-plugin</artifactId>
>    <version>2.8.2</version>
>    <executions>
>        <execution>
>            <id>default-deploy</id>
>            <phase>none</phase>
>            <goals>
>                <goal>deploy</goal>
>            </goals>
>        </execution>
>        <execution>
>            <id>deploy-artifact</id>
>            <phase>deploy</phase>
>            <goals>
>                <goal>deploy-file</goal>
>            </goals>
>            <configuration>
>                <repositoryId>artifactory</repositoryId>
>                <url>https://artifactory.sri.com/artifactory/sunflower-local</url>
>                <file>${project.build.directory}/${project.artifactId}-${docker_env.FLORA_VERSION}-pdf.tar.bz2</file>
>                <groupId>${project.groupId}</groupId>
>                <artifactId>${project.artifactId}</artifactId>
>                <version>${docker_env.FLORA_VERSION}</version>
>                <classifier>pdf</classifier>
>                <packaging>tar.bz2</packaging>
>                <uniqueVersion>false</uniqueVersion>
>            </configuration>
>        </execution>
>    </executions>
> </plugin>
> so I’ve disabled the default-deploy execution, and replacing it with my  
> own deploy-artifact, which runs the deploy-file it deploys both the aux  
> >artifact and the main artifact:
>
> [INFO] --- maven-deploy-plugin:2.8.2:deploy-file (deploy-artifact) @  
> flora2-docs ---
> [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0,  
> ConflictMarker.markTime=0, ConflictMarker.nodeCount=36,  
> >ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0,  
> ConflictIdSorter.conflictIdCount=16,  
> ConflictIdSorter.conflictIdCycleCount=0, >ConflictResolver.totalTime=0,  
> ConflictResolver.conflictItemCount=36,  
> DefaultDependencyCollector.collectTime=3,  
> >DefaultDependencyCollector.transformTime=1}
> [DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2:
> [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
> [DEBUG]    org.apache.maven:maven-project:jar:2.2.1:compile
> [DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
> [DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
> [DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
> [DEBUG]           
> org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
> [DEBUG]           
> backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
> [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
> [DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
> [DEBUG]        
> org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
> [DEBUG]          junit:junit:jar:3.8.1:compile
> [DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
> [DEBUG]    org.apache.maven:maven-model:jar:2.2.1:compile
> [DEBUG]    org.apache.maven:maven-artifact:jar:2.2.1:compile
> [DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.15:compile
> [DEBUG] Created new class realm  
> plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
> [DEBUG] Importing foreign packages into class realm  
> plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
> [DEBUG]   Imported:  < maven.api
> [DEBUG] Populating class realm  
> plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
> [DEBUG]   Included:  
> org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
> [DEBUG]   Included:  
> backport-util-concurrent:backport-util-concurrent:jar:3.1
> [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
> [DEBUG]   Included: junit:junit:jar:3.8.1
> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
> [DEBUG] Configuring mojo  
> org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from  
> plugin realm  
> ClassRealm>[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2,  
> parent: sun.misc.Launcher$AppClassLoader@5c647e05]
> [DEBUG] Configuring mojo  
> 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with  
> basic configurator -->
> [DEBUG]   (f) artifactId = flora2-docs
> [DEBUG]   (f) classifier = pdf
> [DEBUG]   (f) file =  
> /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/target/flora2-docs-1277-pdf.tar.bz2
> [DEBUG]   (f) generatePom = true
> [DEBUG]   (f) groupId = com.sri
> [DEBUG]   (s) localRepository =       id: local
>      url: file:///Users/jklo/.m2/repository/
>   layout: default
> snapshots: [enabled => true, update => always]
> releases: [enabled => true, update => always]
>
> [DEBUG]   (f) offline = false
> [DEBUG]   (f) packaging = tar.bz2
> [DEBUG]   (f) project = MavenProject: com.sri:flora2-docs:0.0.1-SNAPSHOT  
> @  
> /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2->docs/pom.xml
> [DEBUG]   (f) repositoryId = artifactory
> [DEBUG]   (f) repositoryLayout = default
> [DEBUG]   (f) retryFailedDeploymentCount = 1
> [DEBUG]   (f) uniqueVersion = false
> [DEBUG]   (f) updateReleaseInfo = false
> [DEBUG]   (f) url =  
> https://artifactory.sri.com/artifactory/sunflower-local
> [DEBUG]   (f) version = 1277
> [DEBUG] -- end configuration --
> [DEBUG] Using transporter WagonTransporter with priority -1.0 for  
> https://artifactory.sri.com/artifactory/sunflower-local
> [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for  
> https://artifactory.sri.com/artifactory/sunflower-local with  
> >username=e27574, password=***
> Uploading:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2
> Uploaded:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2  
> (3.3 MB at 2.0 MB/s)
> Uploading:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom
> Uploaded:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom  
> (423 B at 3.0 kB/s)
> Downloading:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml
> Downloaded:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml  
> (369 B at 5.8 kB/s)
> [DEBUG] Writing tracking file  
> /Users/jklo/.m2/repository/com/sri/flora2-docs/resolver-status.properties
> Uploading:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml
> Uploaded:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml  
> (322 B at 2.3 kB/s)
> [DEBUG] Using transporter WagonTransporter with priority -1.0 for  
> https://artifactory.sri.com/artifactory/sunflower-local
> [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for  
> https://artifactory.sri.com/artifactory/sunflower-local with  
> >username=e27574, password=***
> Downloading:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml
> [DEBUG] Could not find metadata  
> com.sri:flora2-docs:0.0.1-SNAPSHOT/maven-metadata.xml in artifactory  
> (https://artifactory.sri.com/>artifactory/sunflower-local)
> [DEBUG] Writing tracking file  
> /Users/jklo/.m2/repository/com/sri/flora2-docs/0.0.1-SNAPSHOT/resolver-status.properties
> Uploading:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1->pdf.tar.bz2
> Uploaded:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1->pdf.tar.bz2  
> (3.3 MB at 2.4 MB/s)
> Uploading:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml
> Uploaded:  
> https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml  
> (636 B at 5.0 kB/s)
>
> Is there some way I can suppress the main artifact from being deployed?
>
> Thanks,
>
> Jim

Re: how can I prevent maven-deploy-plugin:deploy-file from deploying main artifact?

Posted by James Klo <ji...@sri.com>.
> On Sep 19, 2017, at 6:42 PM, Russell Gold <ru...@oracle.com> wrote:
> 
> Ah, sorry, I misread what was going on. 
> 
> I looked at the docs for the deploy-file goal and found this:
>> file <>:
>> 
>> File to be deployed.
>> Type: java.io.File
>> Required: Yes
>> User Property: file
>> files <>:
>> 
>> A comma separated list of files for each of the extra side artifacts to deploy. If there is a mis-match in the number of entries in types or classifiers, then an error will be raised.
>> Type: java.lang.String
>> Required: No
>> User Property: files
> 
> I think this may be inconsistent, as the most common convention is that the plural attribute simply allows you to specify multiple values. So I am guessing that deploy-file is simply intended to deploy *additional* files, not replacement files.
> 

Not sure about that, I think you’re partially reading the docs…

http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html <http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html>

note that “file” is required and is the file you’re deploying… and “files” is a csv list of files as extra side artifacts.

Also http://maven.apache.org/plugins/maven-deploy-plugin/ <http://maven.apache.org/plugins/maven-deploy-plugin/>  says:

deploy:deploy-file <http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html> is used to install a single artifact along with its pom. In that case the artifact information can be taken from an optionally specified pomFile, but can be completed/overriden using the command line.
I’ve used this before from CLI and not had this problem, however I’ve never tried doing this from within a POM. I suppose I could cheat and just exec:exec or antrun:run.


> Thus, since your project is a snapshot version, you are getting the snapshot version uploaded. What if you let the default goal happen, get rid of the second execution, and simply set the project version to what you are now calling flora-version? What happens then?
> 

If I make it just any release version - it still pushes two artifacts.  If I just happen to use the same value as flora-version, it only deploys one.  However this is kind of the apex of the problem.. the version of flora is unknown at the start of the reactor build.

Attaching the full pom so it’s more clear. But essentially I need to create an instance of a container which has a very esoteric installation of latex and macros.  That builds some PDF documentation within the container - however the latex source is inside the container which maps to some version within the container.  So after running the container that builds the pdf output - I need to take all those pdf’s and create an artifact from them with a version that matches the flora version in the container.

The problem is that Maven makes certain POM properties immutable such that they cannot be changed at runtime.  If ${project.version} were able to modified, I could solve this quick an easy.  Worst case I assign some bogus release version to my POM and just ignore - but it just seems lame that I can’t make this work the way I need.



>> On Sep 19, 2017, at 6:15 PM, James Klo <ji...@sri.com> wrote:
>> 
>> Thanks for responding.
>> 
>> However, I’m not sure how that changes things.  The “deploy” goal is currently not executing.
>> 
>> The problem seems to me that the “deploy-file” goal is deploying both the file I want in addtion to the main artifact.  
>> 
>> Maybe this is a bug? Seems like it could be.
>> 
>> - JK
>> 
>> On 9/19/17, 3:09 PM, "Russell Gold" <ru...@oracle.com> wrote:
>> 
>>   Instead of 
>> 
>>           <execution>
>>               <id>default-deploy</id>
>>               <phase>none</phase>
>>               <goals>
>>                   <goal>deploy</goal>
>>               </goals>
>>           </execution>
>> 
>>   try
>> 
>>           <execution>
>>               <id>default-deploy</id>
>>               <phase>none</phase>
>>           </execution>
>> 
>>> On Sep 19, 2017, at 5:57 PM, James Klo <ji...@sri.com> wrote:
>>> 
>>> I’m using the io.fabric8:maven-docker-plugin to launch a container, run specialized build that generates some versioned files and then I want to take those files convert them into an artifact and upload them to our corp Artifactory.
>>> 
>>> I’ve got mostly the whole thing working except the last step, deploying to Artifactory.  Yes it deploys, but it deploys too many artifacts.
>>> 
>>> <plugin>
>>>   <groupId>org.apache.maven.plugins</groupId>
>>>   <artifactId>maven-deploy-plugin</artifactId>
>>>   <version>2.8.2</version>
>>>   <executions>
>>>       <execution>
>>>           <id>default-deploy</id>
>>>           <phase>none</phase>
>>>           <goals>
>>>               <goal>deploy</goal>
>>>           </goals>
>>>       </execution>
>>>       <execution>
>>>           <id>deploy-artifact</id>
>>>           <phase>deploy</phase>
>>>           <goals>
>>>               <goal>deploy-file</goal>
>>>           </goals>
>>>           <configuration>
>>>               <repositoryId>artifactory</repositoryId>
>>>               <url>https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local></url>
>>>               <file>${project.build.directory}/${project.artifactId}-${docker_env.FLORA_VERSION}-pdf.tar.bz2</file>
>>>               <groupId>${project.groupId}</groupId>
>>>               <artifactId>${project.artifactId}</artifactId>
>>>               <version>${docker_env.FLORA_VERSION}</version>
>>>               <classifier>pdf</classifier>
>>>               <packaging>tar.bz2</packaging>
>>>               <uniqueVersion>false</uniqueVersion>
>>>           </configuration>
>>>       </execution>
>>>   </executions>
>>> </plugin>
>>> so I’ve disabled the default-deploy execution, and replacing it with my own deploy-artifact, which runs the deploy-file it deploys both the aux artifact and the main artifact:
>>> 
>>> [INFO] --- maven-deploy-plugin:2.8.2:deploy-file (deploy-artifact) @ flora2-docs ---
>>> [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=36, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=16, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=36, DefaultDependencyCollector.collectTime=3, DefaultDependencyCollector.transformTime=1}
>>> [DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2:
>>> [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
>>> [DEBUG]    org.apache.maven:maven-project:jar:2.2.1:compile
>>> [DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
>>> [DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
>>> [DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
>>> [DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
>>> [DEBUG]          backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
>>> [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
>>> [DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
>>> [DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
>>> [DEBUG]          junit:junit:jar:3.8.1:compile
>>> [DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
>>> [DEBUG]    org.apache.maven:maven-model:jar:2.2.1:compile
>>> [DEBUG]    org.apache.maven:maven-artifact:jar:2.2.1:compile
>>> [DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.15:compile
>>> [DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
>>> [DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
>>> [DEBUG]   Imported:  < maven.api
>>> [DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
>>> [DEBUG]   Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
>>> [DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
>>> [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
>>> [DEBUG]   Included: junit:junit:jar:3.8.1
>>> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
>>> [DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
>>> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with basic configurator -->
>>> [DEBUG]   (f) artifactId = flora2-docs
>>> [DEBUG]   (f) classifier = pdf
>>> [DEBUG]   (f) file = /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/target/flora2-docs-1277-pdf.tar.bz2
>>> [DEBUG]   (f) generatePom = true
>>> [DEBUG]   (f) groupId = com.sri
>>> [DEBUG]   (s) localRepository =       id: local
>>>     url: file:///Users/jklo/.m2/repository/ <file:///Users/jklo/.m2/repository/>
>>>  layout: default
>>> snapshots: [enabled => true, update => always]
>>> releases: [enabled => true, update => always]
>>> 
>>> [DEBUG]   (f) offline = false
>>> [DEBUG]   (f) packaging = tar.bz2
>>> [DEBUG]   (f) project = MavenProject: com.sri:flora2-docs:0.0.1-SNAPSHOT @ /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/pom.xml
>>> [DEBUG]   (f) repositoryId = artifactory
>>> [DEBUG]   (f) repositoryLayout = default
>>> [DEBUG]   (f) retryFailedDeploymentCount = 1
>>> [DEBUG]   (f) uniqueVersion = false
>>> [DEBUG]   (f) updateReleaseInfo = false
>>> [DEBUG]   (f) url = https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
>>> [DEBUG]   (f) version = 1277
>>> [DEBUG] -- end configuration --
>>> [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
>>> [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local> with username=e27574, password=***
>>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2>
>>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2> (3.3 MB at 2.0 MB/s)
>>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom>
>>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom> (423 B at 3.0 kB/s)
>>> Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml>
>>> Downloaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml> (369 B at 5.8 kB/s)
>>> [DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/resolver-status.properties
>>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml>
>>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml> (322 B at 2.3 kB/s)
>>> [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
>>> [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local> with username=e27574, password=***
>>> Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml>
>>> [DEBUG] Could not find metadata com.sri:flora2-docs:0.0.1-SNAPSHOT/maven-metadata.xml in artifactory (https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>)
>>> [DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/0.0.1-SNAPSHOT/resolver-status.properties
>>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2>
>>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2> (3.3 MB at 2.4 MB/s)
>>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml>
>>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml> (636 B at 5.0 kB/s)
>>> 
>>> Is there some way I can suppress the main artifact from being deployed?
>>> 
>>> Thanks,
>>> 
>>> Jim
>>> 
>>> 
>>> 
>> 
>> 
> 


Re: how can I prevent maven-deploy-plugin:deploy-file from deploying main artifact?

Posted by Russell Gold <ru...@oracle.com>.
Ah, sorry, I misread what was going on. 

I looked at the docs for the deploy-file goal and found this:
> file <>:
> 
> File to be deployed.
> Type: java.io.File
> Required: Yes
> User Property: file
> files <>:
> 
> A comma separated list of files for each of the extra side artifacts to deploy. If there is a mis-match in the number of entries in types or classifiers, then an error will be raised.
> Type: java.lang.String
> Required: No
> User Property: files

I think this may be inconsistent, as the most common convention is that the plural attribute simply allows you to specify multiple values. So I am guessing that deploy-file is simply intended to deploy *additional* files, not replacement files.

Thus, since your project is a snapshot version, you are getting the snapshot version uploaded. What if you let the default goal happen, get rid of the second execution, and simply set the project version to what you are now calling flora-version? What happens then?

> On Sep 19, 2017, at 6:15 PM, James Klo <ji...@sri.com> wrote:
> 
> Thanks for responding.
> 
> However, I’m not sure how that changes things.  The “deploy” goal is currently not executing.
> 
> The problem seems to me that the “deploy-file” goal is deploying both the file I want in addtion to the main artifact.  
> 
> Maybe this is a bug? Seems like it could be.
> 
> - JK
> 
> On 9/19/17, 3:09 PM, "Russell Gold" <ru...@oracle.com> wrote:
> 
>    Instead of 
> 
>            <execution>
>                <id>default-deploy</id>
>                <phase>none</phase>
>                <goals>
>                    <goal>deploy</goal>
>                </goals>
>            </execution>
> 
>    try
> 
>            <execution>
>                <id>default-deploy</id>
>                <phase>none</phase>
>            </execution>
> 
>> On Sep 19, 2017, at 5:57 PM, James Klo <ji...@sri.com> wrote:
>> 
>> I’m using the io.fabric8:maven-docker-plugin to launch a container, run specialized build that generates some versioned files and then I want to take those files convert them into an artifact and upload them to our corp Artifactory.
>> 
>> I’ve got mostly the whole thing working except the last step, deploying to Artifactory.  Yes it deploys, but it deploys too many artifacts.
>> 
>> <plugin>
>>    <groupId>org.apache.maven.plugins</groupId>
>>    <artifactId>maven-deploy-plugin</artifactId>
>>    <version>2.8.2</version>
>>    <executions>
>>        <execution>
>>            <id>default-deploy</id>
>>            <phase>none</phase>
>>            <goals>
>>                <goal>deploy</goal>
>>            </goals>
>>        </execution>
>>        <execution>
>>            <id>deploy-artifact</id>
>>            <phase>deploy</phase>
>>            <goals>
>>                <goal>deploy-file</goal>
>>            </goals>
>>            <configuration>
>>                <repositoryId>artifactory</repositoryId>
>>                <url>https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local></url>
>>                <file>${project.build.directory}/${project.artifactId}-${docker_env.FLORA_VERSION}-pdf.tar.bz2</file>
>>                <groupId>${project.groupId}</groupId>
>>                <artifactId>${project.artifactId}</artifactId>
>>                <version>${docker_env.FLORA_VERSION}</version>
>>                <classifier>pdf</classifier>
>>                <packaging>tar.bz2</packaging>
>>                <uniqueVersion>false</uniqueVersion>
>>            </configuration>
>>        </execution>
>>    </executions>
>> </plugin>
>> so I’ve disabled the default-deploy execution, and replacing it with my own deploy-artifact, which runs the deploy-file it deploys both the aux artifact and the main artifact:
>> 
>> [INFO] --- maven-deploy-plugin:2.8.2:deploy-file (deploy-artifact) @ flora2-docs ---
>> [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=36, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=16, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=36, DefaultDependencyCollector.collectTime=3, DefaultDependencyCollector.transformTime=1}
>> [DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2:
>> [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
>> [DEBUG]    org.apache.maven:maven-project:jar:2.2.1:compile
>> [DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
>> [DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
>> [DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
>> [DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
>> [DEBUG]          backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
>> [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
>> [DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
>> [DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
>> [DEBUG]          junit:junit:jar:3.8.1:compile
>> [DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
>> [DEBUG]    org.apache.maven:maven-model:jar:2.2.1:compile
>> [DEBUG]    org.apache.maven:maven-artifact:jar:2.2.1:compile
>> [DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.15:compile
>> [DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
>> [DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
>> [DEBUG]   Imported:  < maven.api
>> [DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
>> [DEBUG]   Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
>> [DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
>> [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
>> [DEBUG]   Included: junit:junit:jar:3.8.1
>> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
>> [DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
>> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with basic configurator -->
>> [DEBUG]   (f) artifactId = flora2-docs
>> [DEBUG]   (f) classifier = pdf
>> [DEBUG]   (f) file = /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/target/flora2-docs-1277-pdf.tar.bz2
>> [DEBUG]   (f) generatePom = true
>> [DEBUG]   (f) groupId = com.sri
>> [DEBUG]   (s) localRepository =       id: local
>>      url: file:///Users/jklo/.m2/repository/ <file:///Users/jklo/.m2/repository/>
>>   layout: default
>> snapshots: [enabled => true, update => always]
>> releases: [enabled => true, update => always]
>> 
>> [DEBUG]   (f) offline = false
>> [DEBUG]   (f) packaging = tar.bz2
>> [DEBUG]   (f) project = MavenProject: com.sri:flora2-docs:0.0.1-SNAPSHOT @ /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/pom.xml
>> [DEBUG]   (f) repositoryId = artifactory
>> [DEBUG]   (f) repositoryLayout = default
>> [DEBUG]   (f) retryFailedDeploymentCount = 1
>> [DEBUG]   (f) uniqueVersion = false
>> [DEBUG]   (f) updateReleaseInfo = false
>> [DEBUG]   (f) url = https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
>> [DEBUG]   (f) version = 1277
>> [DEBUG] -- end configuration --
>> [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
>> [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local> with username=e27574, password=***
>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2>
>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2> (3.3 MB at 2.0 MB/s)
>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom>
>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom> (423 B at 3.0 kB/s)
>> Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml>
>> Downloaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml> (369 B at 5.8 kB/s)
>> [DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/resolver-status.properties
>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml>
>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml> (322 B at 2.3 kB/s)
>> [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
>> [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local> with username=e27574, password=***
>> Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml>
>> [DEBUG] Could not find metadata com.sri:flora2-docs:0.0.1-SNAPSHOT/maven-metadata.xml in artifactory (https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>)
>> [DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/0.0.1-SNAPSHOT/resolver-status.properties
>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2>
>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2> (3.3 MB at 2.4 MB/s)
>> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml>
>> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml> (636 B at 5.0 kB/s)
>> 
>> Is there some way I can suppress the main artifact from being deployed?
>> 
>> Thanks,
>> 
>> Jim
>> 
>> 
>> 
> 
> 


Re: how can I prevent maven-deploy-plugin:deploy-file from deploying main artifact?

Posted by James Klo <ji...@sri.com>.
Thanks for responding.

However, I’m not sure how that changes things.  The “deploy” goal is currently not executing.

The problem seems to me that the “deploy-file” goal is deploying both the file I want in addtion to the main artifact.  

Maybe this is a bug? Seems like it could be.
 
- JK

On 9/19/17, 3:09 PM, "Russell Gold" <ru...@oracle.com> wrote:

    Instead of 
    
            <execution>
                <id>default-deploy</id>
                <phase>none</phase>
                <goals>
                    <goal>deploy</goal>
                </goals>
            </execution>
    
    try
    
            <execution>
                <id>default-deploy</id>
                <phase>none</phase>
            </execution>
    
    > On Sep 19, 2017, at 5:57 PM, James Klo <ji...@sri.com> wrote:
    > 
    > I’m using the io.fabric8:maven-docker-plugin to launch a container, run specialized build that generates some versioned files and then I want to take those files convert them into an artifact and upload them to our corp Artifactory.
    > 
    > I’ve got mostly the whole thing working except the last step, deploying to Artifactory.  Yes it deploys, but it deploys too many artifacts.
    > 
    > <plugin>
    >     <groupId>org.apache.maven.plugins</groupId>
    >     <artifactId>maven-deploy-plugin</artifactId>
    >     <version>2.8.2</version>
    >     <executions>
    >         <execution>
    >             <id>default-deploy</id>
    >             <phase>none</phase>
    >             <goals>
    >                 <goal>deploy</goal>
    >             </goals>
    >         </execution>
    >         <execution>
    >             <id>deploy-artifact</id>
    >             <phase>deploy</phase>
    >             <goals>
    >                 <goal>deploy-file</goal>
    >             </goals>
    >             <configuration>
    >                 <repositoryId>artifactory</repositoryId>
    >                 <url>https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local></url>
    >                 <file>${project.build.directory}/${project.artifactId}-${docker_env.FLORA_VERSION}-pdf.tar.bz2</file>
    >                 <groupId>${project.groupId}</groupId>
    >                 <artifactId>${project.artifactId}</artifactId>
    >                 <version>${docker_env.FLORA_VERSION}</version>
    >                 <classifier>pdf</classifier>
    >                 <packaging>tar.bz2</packaging>
    >                 <uniqueVersion>false</uniqueVersion>
    >             </configuration>
    >         </execution>
    >     </executions>
    > </plugin>
    > so I’ve disabled the default-deploy execution, and replacing it with my own deploy-artifact, which runs the deploy-file it deploys both the aux artifact and the main artifact:
    > 
    > [INFO] --- maven-deploy-plugin:2.8.2:deploy-file (deploy-artifact) @ flora2-docs ---
    > [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=36, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=16, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=36, DefaultDependencyCollector.collectTime=3, DefaultDependencyCollector.transformTime=1}
    > [DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2:
    > [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
    > [DEBUG]    org.apache.maven:maven-project:jar:2.2.1:compile
    > [DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
    > [DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
    > [DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
    > [DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
    > [DEBUG]          backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
    > [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
    > [DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
    > [DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
    > [DEBUG]          junit:junit:jar:3.8.1:compile
    > [DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
    > [DEBUG]    org.apache.maven:maven-model:jar:2.2.1:compile
    > [DEBUG]    org.apache.maven:maven-artifact:jar:2.2.1:compile
    > [DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.15:compile
    > [DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
    > [DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
    > [DEBUG]   Imported:  < maven.api
    > [DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
    > [DEBUG]   Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
    > [DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
    > [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
    > [DEBUG]   Included: junit:junit:jar:3.8.1
    > [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
    > [DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
    > [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with basic configurator -->
    > [DEBUG]   (f) artifactId = flora2-docs
    > [DEBUG]   (f) classifier = pdf
    > [DEBUG]   (f) file = /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/target/flora2-docs-1277-pdf.tar.bz2
    > [DEBUG]   (f) generatePom = true
    > [DEBUG]   (f) groupId = com.sri
    > [DEBUG]   (s) localRepository =       id: local
    >       url: file:///Users/jklo/.m2/repository/ <file:///Users/jklo/.m2/repository/>
    >    layout: default
    > snapshots: [enabled => true, update => always]
    >  releases: [enabled => true, update => always]
    > 
    > [DEBUG]   (f) offline = false
    > [DEBUG]   (f) packaging = tar.bz2
    > [DEBUG]   (f) project = MavenProject: com.sri:flora2-docs:0.0.1-SNAPSHOT @ /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/pom.xml
    > [DEBUG]   (f) repositoryId = artifactory
    > [DEBUG]   (f) repositoryLayout = default
    > [DEBUG]   (f) retryFailedDeploymentCount = 1
    > [DEBUG]   (f) uniqueVersion = false
    > [DEBUG]   (f) updateReleaseInfo = false
    > [DEBUG]   (f) url = https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
    > [DEBUG]   (f) version = 1277
    > [DEBUG] -- end configuration --
    > [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
    > [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local> with username=e27574, password=***
    > Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2>
    > Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2> (3.3 MB at 2.0 MB/s)
    > Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom>
    > Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom> (423 B at 3.0 kB/s)
    > Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml>
    > Downloaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml> (369 B at 5.8 kB/s)
    > [DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/resolver-status.properties
    > Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml>
    > Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml> (322 B at 2.3 kB/s)
    > [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
    > [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local> with username=e27574, password=***
    > Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml>
    > [DEBUG] Could not find metadata com.sri:flora2-docs:0.0.1-SNAPSHOT/maven-metadata.xml in artifactory (https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>)
    > [DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/0.0.1-SNAPSHOT/resolver-status.properties
    > Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2>
    > Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2> (3.3 MB at 2.4 MB/s)
    > Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml>
    > Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml> (636 B at 5.0 kB/s)
    > 
    > Is there some way I can suppress the main artifact from being deployed?
    > 
    > Thanks,
    > 
    > Jim
    > 
    > 
    > 
    
    

Re: how can I prevent maven-deploy-plugin:deploy-file from deploying main artifact?

Posted by Russell Gold <ru...@oracle.com>.
Instead of 

        <execution>
            <id>default-deploy</id>
            <phase>none</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>

try

        <execution>
            <id>default-deploy</id>
            <phase>none</phase>
        </execution>

> On Sep 19, 2017, at 5:57 PM, James Klo <ji...@sri.com> wrote:
> 
> I’m using the io.fabric8:maven-docker-plugin to launch a container, run specialized build that generates some versioned files and then I want to take those files convert them into an artifact and upload them to our corp Artifactory.
> 
> I’ve got mostly the whole thing working except the last step, deploying to Artifactory.  Yes it deploys, but it deploys too many artifacts.
> 
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-deploy-plugin</artifactId>
>     <version>2.8.2</version>
>     <executions>
>         <execution>
>             <id>default-deploy</id>
>             <phase>none</phase>
>             <goals>
>                 <goal>deploy</goal>
>             </goals>
>         </execution>
>         <execution>
>             <id>deploy-artifact</id>
>             <phase>deploy</phase>
>             <goals>
>                 <goal>deploy-file</goal>
>             </goals>
>             <configuration>
>                 <repositoryId>artifactory</repositoryId>
>                 <url>https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local></url>
>                 <file>${project.build.directory}/${project.artifactId}-${docker_env.FLORA_VERSION}-pdf.tar.bz2</file>
>                 <groupId>${project.groupId}</groupId>
>                 <artifactId>${project.artifactId}</artifactId>
>                 <version>${docker_env.FLORA_VERSION}</version>
>                 <classifier>pdf</classifier>
>                 <packaging>tar.bz2</packaging>
>                 <uniqueVersion>false</uniqueVersion>
>             </configuration>
>         </execution>
>     </executions>
> </plugin>
> so I’ve disabled the default-deploy execution, and replacing it with my own deploy-artifact, which runs the deploy-file it deploys both the aux artifact and the main artifact:
> 
> [INFO] --- maven-deploy-plugin:2.8.2:deploy-file (deploy-artifact) @ flora2-docs ---
> [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=36, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=16, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=36, DefaultDependencyCollector.collectTime=3, DefaultDependencyCollector.transformTime=1}
> [DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2:
> [DEBUG]    org.apache.maven:maven-plugin-api:jar:2.2.1:compile
> [DEBUG]    org.apache.maven:maven-project:jar:2.2.1:compile
> [DEBUG]       org.apache.maven:maven-settings:jar:2.2.1:compile
> [DEBUG]       org.apache.maven:maven-profile:jar:2.2.1:compile
> [DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
> [DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
> [DEBUG]          backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
> [DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
> [DEBUG]       org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
> [DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
> [DEBUG]          junit:junit:jar:3.8.1:compile
> [DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
> [DEBUG]    org.apache.maven:maven-model:jar:2.2.1:compile
> [DEBUG]    org.apache.maven:maven-artifact:jar:2.2.1:compile
> [DEBUG]    org.codehaus.plexus:plexus-utils:jar:3.0.15:compile
> [DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
> [DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
> [DEBUG]   Imported:  < maven.api
> [DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
> [DEBUG]   Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.8.2
> [DEBUG]   Included: backport-util-concurrent:backport-util-concurrent:jar:3.1
> [DEBUG]   Included: org.codehaus.plexus:plexus-interpolation:jar:1.11
> [DEBUG]   Included: junit:junit:jar:3.8.1
> [DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:3.0.15
> [DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@5c647e05]
> [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with basic configurator -->
> [DEBUG]   (f) artifactId = flora2-docs
> [DEBUG]   (f) classifier = pdf
> [DEBUG]   (f) file = /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/target/flora2-docs-1277-pdf.tar.bz2
> [DEBUG]   (f) generatePom = true
> [DEBUG]   (f) groupId = com.sri
> [DEBUG]   (s) localRepository =       id: local
>       url: file:///Users/jklo/.m2/repository/ <file:///Users/jklo/.m2/repository/>
>    layout: default
> snapshots: [enabled => true, update => always]
>  releases: [enabled => true, update => always]
> 
> [DEBUG]   (f) offline = false
> [DEBUG]   (f) packaging = tar.bz2
> [DEBUG]   (f) project = MavenProject: com.sri:flora2-docs:0.0.1-SNAPSHOT @ /Users/jklo/projects/RAVE/source/sunflower-docs/doc/flora2-docs/pom.xml
> [DEBUG]   (f) repositoryId = artifactory
> [DEBUG]   (f) repositoryLayout = default
> [DEBUG]   (f) retryFailedDeploymentCount = 1
> [DEBUG]   (f) uniqueVersion = false
> [DEBUG]   (f) updateReleaseInfo = false
> [DEBUG]   (f) url = https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
> [DEBUG]   (f) version = 1277
> [DEBUG] -- end configuration --
> [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
> [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local> with username=e27574, password=***
> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2>
> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277-pdf.tar.bz2> (3.3 MB at 2.0 MB/s)
> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom>
> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/1277/flora2-docs-1277.pom> (423 B at 3.0 kB/s)
> Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml>
> Downloaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml> (369 B at 5.8 kB/s)
> [DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/resolver-status.properties
> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml>
> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/maven-metadata.xml> (322 B at 2.3 kB/s)
> [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>
> [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local> with username=e27574, password=***
> Downloading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml>
> [DEBUG] Could not find metadata com.sri:flora2-docs:0.0.1-SNAPSHOT/maven-metadata.xml in artifactory (https://artifactory.sri.com/artifactory/sunflower-local <https://artifactory.sri.com/artifactory/sunflower-local>)
> [DEBUG] Writing tracking file /Users/jklo/.m2/repository/com/sri/flora2-docs/0.0.1-SNAPSHOT/resolver-status.properties
> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2>
> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2 <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/flora2-docs-0.0.1-20170919.214604-1-pdf.tar.bz2> (3.3 MB at 2.4 MB/s)
> Uploading: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml>
> Uploaded: https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml <https://artifactory.sri.com/artifactory/sunflower-local/com/sri/flora2-docs/0.0.1-SNAPSHOT/maven-metadata.xml> (636 B at 5.0 kB/s)
> 
> Is there some way I can suppress the main artifact from being deployed?
> 
> Thanks,
> 
> Jim
> 
> 
>