On Sep 19, 2017, at 6:42 PM, Russell Gold <[email protected]> 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…


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


  • deploy:deploy-file 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.

Attachment: pom.xml
Description: XML document


On Sep 19, 2017, at 6:15 PM, James Klo <[email protected]> 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" <[email protected]> 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 <[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 <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 = "" href="https://artifactory.sri.com/artifactory/sunflower-local" class="">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







Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to