2

I'm building a multiplatform javafx application. The final process is to create an installer (exe,dmg,deb.. with jre bundled) and upload it to a special "product release" repo. Given how javafx build needs to be done, it runs an jenkins matrix job on 3 different platforms. The last step is the deployment. I attach the installer with the build-helper-maven plugin.

I'm able to upload the installer correctly for one platform, but because the deploy seems to upload the pom file, it cannot be uploaded again from another jenkins slave.

First I was having problem of maven uploading the "main jar", but I managed to disable that by binding the jar plugin to 'none' phase (I use the maven-javafx-plugin which creates own main jar). However I'm unable to disable the pom generation and uploading. I have set

<generatePom>false</generatePom> 

for the maven-deploy-plugin but it seems to not have any effect (I assume it works for the main jar which I have already disabled).

Is it possible to disable the pom generation/upload completely (similar like gradle's 'uploadDescriptor false' option) and only upload 'attached artifacts' ?

EDIT/NOTE: I probably try the deploy file option next, https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html, but it would be nice to know if this can be done on the complete project level

Bjarne Boström
  • 227
  • 1
  • 4
  • 14
  • Is you release repo a Maven repo in a kind of Nexus/Artifactory/Archiva based ? BTW: `..` does not exist for [maven-deploy-plugin](https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html) so it couldn't have any effect... – khmarbaise Mar 21 '16 at 13:27
  • Yes, nexus. Same as central proxy/company internal, but this one has different directory path. It is more or less "a trick" to push anything from jenkins slave nodes to a corrent disk with the same credentials. After it has been uploaded it does not matter that it is a maven repo (i.e. follow distribution only uses the disk) – Bjarne Boström Mar 21 '16 at 13:35
  • So if you use such kind of repo why is it a problem having pom files in there? May be you need to go a different way. Deploy the resulting build artifacts to the Nexus (repository) and with a post step in Jenkins you can get the artifacts (installers only) and deploy them to the release repo...But if it is maven based you need having pom files... – khmarbaise Mar 21 '16 at 13:37
  • Might be. The problem is that it is a release type repo, so the pom files can be only uploaded once. I'm uploading 3 times, in parallel, for each platform, therefore the build will fail because the pom.xml can only be uploaded once because it is a release repository. With gradle I could just say "uploadDescriptor false" to prevent any pom files from being generated. Maybe I just need to do the deploy file option and hope generatePom false works that way (Kinda whished theyre would have been easier way) – Bjarne Boström Mar 21 '16 at 13:46
  • Ah...you create different artifacts via profile for each platform ? What are the differences between the platforms ? (can you say which platforms we are talking about?) – khmarbaise Mar 21 '16 at 14:00
  • Not exacly, I pass bundler argument to javafx-maven-plugin via command line (or well the jenkins execute maven top lvl...build step). On windows this creates exe, on osx dmg and on linux deb/rpm. Each of these build machine must upload the installer back and the easiest was to have them deploy it to nexus (I have done this previously successfully with gradle and now trying with maven). Effectivy each jenkins node has an environment variable that defines which type of bundle it is able to make and one jenkins matrix job executes it on all needed platforms. – Bjarne Boström Mar 21 '16 at 14:07
  • OK seems that I got it to work somewhat at least.. I will post answer below soon – Bjarne Boström Mar 21 '16 at 14:11

1 Answers1

0

I managed to solve this. I did it with the deploy-file option:

I bound the default-deploy to none in order to disable it. Then I made new "native-deploy" execution which I bound to deploy phase. In it's configuration I put the generatePom false and pointed the file to the same I was earlier using to attach it as side artifact (via the build helper plugin). I did have to put the coodrinates again (i.e. passtrough from project.*). But did work and uploaded the installers from all machines without any pom files. I did have to re-enable the default jar creation because maven complained that there is no artifact bound (I guess I could change the packaging to be pom, anyway it is not uploaded because the default upload is disabled so ok there).

I guess if there is more general solution it would be more correct answer but for me this is enough.

Bjarne Boström
  • 227
  • 1
  • 4
  • 14
  • Wouldn't using `wagon-maven-plugin` be a simpler option? https://stackoverflow.com/a/42468595/318054 – ᄂ ᄀ Mar 11 '17 at 11:12