Plugin installation without restart

Michael Zangl openstreetmap at michaelzangl.de
Wed Feb 27 17:56:47 UTC 2019


Hi,

A plugin update always requires a restart - you cannot get around this.

The technical reason is that JOSM cannot unload the old plugin classes. This is why an activation of a plugin is possible without restart, but deactivating it is not.

Am 27. Februar 2019 13:33:49 MEZ schrieb Jiri Vlasak <jiri.hubacek at gmail.com>:
>Hi Gerd,
>
>thanks for your time. I am pretty sure I miss something trivial.
>
>On Sat, Feb 23, 2019 at 08:10:12AM +0000, Gerd Petermann wrote:
>> Hi Jiri,
>> 
>> my understanding is that your plugin either requires a restart (set
>plugin.canloadatruntime to false in build.xml)
>
>The `canLoadAtRuntime = true` should be set properly [1].
>
>> or it should work so that it reacts on a event to rebuild everything
>(maybe costly)
>
>I am confused a little bit with "reacts on a event" part. The plugin
>constructor add entries to menu:
>
>    public class MapathonerPlugin extends Plugin
>    {
>        /**
>         * Constructs a new {@code MapathonerPlugin}.
>         */
>        public MapathonerPlugin(PluginInformation info)
>        {
>            super(info);
>            MainMenu mm = MainApplication.getMenu();
>            JMenu hm = mm.addMenu("Mapathoner",
>                    tr("Mapathoner"),
>                    KeyEvent.VK_M,
>                    mm.getDefaultMenuPos(),
>                    ht("/Plugin/Mapathoner"));
>    
>            hm.setMnemonic(KeyEvent.VK_M);
>    
>            mm.add(hm, new BatchCircleBuildingAction());
>            mm.add(hm, new BatchOrthogonalBuildingAction());
>            mm.add(hm, new BatchLBuildingAction());
>            hm.addSeparator();
>            mm.add(hm, new PickResidentialAreaAction());
>        }
>    }
>
>Which should be ok ("Adding a menu entry to the main menu in the plugin
>Constructor" [3]). Also, shortcuts are bound to actions.
>
>Thanks for any pointer,
>jiri
>
>[1]: https://gitlab.com/qeef/mapathoner/blob/master/build.gradle
>[2]:
>https://gitlab.com/qeef/mapathoner/blob/master/src/main/java/org/openstreetmap/josm/plugins/mapathoner/MapathonerPlugin.java
>[3]:
>https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart
>
>> Gerd
>> 
>> ________________________________________
>> Von: Jiri Vlasak <jiri.hubacek at gmail.com>
>> Gesendet: Dienstag, 19. Februar 2019 07:47
>> An: josm-dev at openstreetmap.org
>> Betreff: Plugin installation without restart
>> 
>> Dear JOSM devs,
>> 
>> I would like to ask about the difference between installing and
>upgrading JOSM
>> plugin. In my case, the installation does not the restart of JOSM
>[1]. However,
>> when the plugin is upgraded, the new functionality does not work
>until restart.
>> 
>> The plugin adds JMenu with multiple options.
>> 
>> Thanks,
>> jiri
>> 
>> [1]:
>https://josm.openstreetmap.de/wiki/DevelopersGuide/PluginInstallationWithoutRestart
>> 


More information about the josm-dev mailing list