Best way to create daily SNAPSHOT updates in autoupdate center?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to create daily SNAPSHOT updates in autoupdate center?

William Winder
My project currently makes a ZIP package available to users which is updated whenever I push changes to github. I recently started deploying autoupdate artifacts along with the ZIP, but the application doesn't pick them up unless I bump the module versions as well.

Is there a way to get autoupdate to use the "releasedate" in addition to the "OpenIDE-Module-Specification-Version" to indicate that an NBM should be updated?




Reply | Threaded
Open this post in threaded view
|

Re: Best way to create daily SNAPSHOT updates in autoupdate center?

arsi
Hi,

It is maven, or Netbeans project?

Arsi




From: Winder
Sent: Saturday, August 19, 2017 8:11PM
To: Dev
Subject: [platform-dev] Best way to create daily SNAPSHOT updates in
autoupdate center?


My project currently makes a ZIP package available to users which is updated whenever I push changes to github. I recently started deploying autoupdate artifacts along with the ZIP, but the application doesn't pick them up unless I bump the module versions as well.

Is there a way to get autoupdate to use the "releasedate" in addition to the "OpenIDE-Module-Specification-Version" to indicate that an NBM should be updated?











 

Reply | Threaded
Open this post in threaded view
|

Re: Best way to create daily SNAPSHOT updates in autoupdate center?

William Winder
It is a maven project. I found a roundabout workaround for now but am hopeful there is a less invasive way to go about it. For example the proposal described here is exactly what I'm looking for: http://wiki.netbeans.org/MavenNBM4#Versioning


I updated my manifest.mf files to include the following line:

    OpenIDE-Module-Specification-Version: ${ugs.modules.specification.version}


Used the "maven-resources-plugin" resources plugin I copy that file to the target directory with " <filtering>true</filtering>" to fill make the substitution.

Making sure the "nbm-maven-plugin" is configured to look there with "<sourceManifestFile>${project.build.directory}/manifest.mf</sourceManifestFile>"


Now things get a little hacky, I need to parse 1.2.3 out of 1.2.3-SNAPSHOT. I used the "build-helper-maven-plugin" gives you maven variables like "${parsedVersion.majorVersion}" and allowed me to define my version like:

      <maven.build.timestamp.format>yyyy.MM.dd.HH.mm</maven.build.timestamp.format>

      <ugs.modules.specification.version>        ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${maven.build.timestamp}</ugs.modules.specification.version>


Now everytime I rebuild my snapshot there will be a unique version.

Reply | Threaded
Open this post in threaded view
|

Re: Best way to create daily SNAPSHOT updates in autoupdate center?

William Winder
The actual implementation is on github. It works exactly the way I hoped it would. The main downside is that I'll need to remember to configure every plugin manifest to include "OpenIDE-Module-Implementation-Version".

Add filtering to manifest files:

Parse major/minor/incremental versions out of "1.2.3-SNAPSHOT" and append ".yyyy.MM.dd.HH.mm":

On Tue, Aug 22, 2017 at 11:47 AM, William Winder <[hidden email]> wrote:
It is a maven project. I found a roundabout workaround for now but am hopeful there is a less invasive way to go about it. For example the proposal described here is exactly what I'm looking for: http://wiki.netbeans.org/MavenNBM4#Versioning


I updated my manifest.mf files to include the following line:

    OpenIDE-Module-Specification-Version: ${ugs.modules.specification.version}


Used the "maven-resources-plugin" resources plugin I copy that file to the target directory with " <filtering>true</filtering>" to fill make the substitution.

Making sure the "nbm-maven-plugin" is configured to look there with "<sourceManifestFile>${project.build.directory}/manifest.mf</sourceManifestFile>"


Now things get a little hacky, I need to parse 1.2.3 out of 1.2.3-SNAPSHOT. I used the "build-helper-maven-plugin" gives you maven variables like "${parsedVersion.majorVersion}" and allowed me to define my version like:

      <maven.build.timestamp.format>yyyy.MM.dd.HH.mm</maven.build.timestamp.format>

      <ugs.modules.specification.version>        ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${maven.build.timestamp}</ugs.modules.specification.version>


Now everytime I rebuild my snapshot there will be a unique version.


Reply | Threaded
Open this post in threaded view
|

Re: Best way to create daily SNAPSHOT updates in autoupdate center?

arsi
In reply to this post by William Winder
Hi,

For my project I made a maven plugin for zip and autoupdate upload over sftp:

https://sourceforge.net/p/cscm/code/ci/default/tree/


I personally would go by way of changing the module version in the pom from mojo or by customized  version generation in nbm-maven-plugin..

Arsi




From: William Winder
Sent: Tuesday, August 22, 2017 5:47PM
To: Dev
Subject: [platform-dev] Re: Best way to create daily SNAPSHOT updates in
autoupdate center?


It is a maven project. I found a roundabout workaround for now but am hopeful there is a less invasive way to go about it. For example the proposal described here is exactly what I'm looking for: http://wiki.netbeans.org/MavenNBM4#Versioning


I updated my manifest.mf files to include the following line:

    OpenIDE-Module-Specification-Version: ${ugs.modules.specification.version}


Used the "maven-resources-plugin" resources plugin I copy that file to the target directory with " <filtering>true</filtering>" to fill make the substitution.

Making sure the "nbm-maven-plugin" is configured to look there with "<sourceManifestFile>${project.build.directory}/manifest.mf</sourceManifestFile>"


Now things get a little hacky, I need to parse 1.2.3 out of 1.2.3-SNAPSHOT. I used the "build-helper-maven-plugin" gives you maven variables like "${parsedVersion.majorVersion}" and allowed me to define my version like:

      <maven.build.timestamp.format>yyyy.MM.dd.HH.mm</maven.build.timestamp.format>

      <ugs.modules.specification.version>        ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${maven.build.timestamp}</ugs.modules.specification.version>


Now everytime I rebuild my snapshot there will be a unique version.







 

Reply | Threaded
Open this post in threaded view
|

Re: Best way to create daily SNAPSHOT updates in autoupdate center?

William Winder
Thanks Arsi, I'll study your project and see what I can learn. It looks like you forked the nbm-maven-plugin, is that correct?

I was looking at it's implementation the other day and wanting to make a small change in there instead of jumping through all these hoops: https://github.com/mojohaus/nbm-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/nbm/AdaptNbVersion.java

On Tue, Aug 22, 2017 at 12:19 PM, arsi <[hidden email]> wrote:
Hi,

For my project I made a maven plugin for zip and autoupdate upload over sftp:

https://sourceforge.net/p/cscm/code/ci/default/tree/


I personally would go by way of changing the module version in the pom from mojo or by customized  version generation in nbm-maven-plugin..

Arsi




From: William Winder
Sent: Tuesday, August 22, 2017 5:47PM
To: Dev
Subject: [platform-dev] Re: Best way to create daily SNAPSHOT updates in
autoupdate center?


It is a maven project. I found a roundabout workaround for now but am hopeful there is a less invasive way to go about it. For example the proposal described here is exactly what I'm looking for: http://wiki.netbeans.org/MavenNBM4#Versioning


I updated my manifest.mf files to include the following line:

    OpenIDE-Module-Specification-Version: ${ugs.modules.specification.version}


Used the "maven-resources-plugin" resources plugin I copy that file to the target directory with " <filtering>true</filtering>" to fill make the substitution.

Making sure the "nbm-maven-plugin" is configured to look there with "<sourceManifestFile>${project.build.directory}/manifest.mf</sourceManifestFile>"


Now things get a little hacky, I need to parse 1.2.3 out of 1.2.3-SNAPSHOT. I used the "build-helper-maven-plugin" gives you maven variables like "${parsedVersion.majorVersion}" and allowed me to define my version like:

      <maven.build.timestamp.format>yyyy.MM.dd.HH.mm</maven.build.timestamp.format>

      <ugs.modules.specification.version>        ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${maven.build.timestamp}</ugs.modules.specification.version>


Now everytime I rebuild my snapshot there will be a unique version.







 


Reply | Threaded
Open this post in threaded view
|

Re: Best way to create daily SNAPSHOT updates in autoupdate center?

arsi
Hi,
There was a bug:

https://github.com/mojohaus/nbm-maven-plugin/issues/27

I got an idea:

To add to the nbm-maven-plugin one config line..
<configuration>
                   <snapshotMinorVersion>/path/to/current/version.ini</snapshotMinorVersion>
                     ....

</configuration>

version.ini
minor_version = 10

And when it is defined, it takes the major version of pom and minor from ini. And plugin after autoupdate increments  the minor version in .ini
If you want , I can write a patch for
nbm-maven-plugin

Arsi


From: William Winder
Sent: Tuesday, August 22, 2017 6:30PM
To: Dev
Subject: [platform-dev] Re: Best way to create daily SNAPSHOT updates in
autoupdate center?


Thanks Arsi, I'll study your project and see what I can learn. It looks like you forked the nbm-maven-plugin, is that correct?

I was looking at it's implementation the other day and wanting to make a small change in there instead of jumping through all these hoops: https://github.com/mojohaus/nbm-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/nbm/AdaptNbVersion.java

On Tue, Aug 22, 2017 at 12:19 PM, arsi <[hidden email]> wrote:
Hi,

For my project I made a maven plugin for zip and autoupdate upload over sftp:

https://sourceforge.net/p/cscm/code/ci/default/tree/


I personally would go by way of changing the module version in the pom from mojo or by customized  version generation in nbm-maven-plugin..

Arsi