Hi Robert,

Thanks for the reply.

On Sep 20, 2017, at 1:05 AM, Robert Scholte 
<[email protected]<mailto:[email protected]>> 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 
<[email protected]<mailto:[email protected]>> 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






Reply via email to