imagej / imagej-maven-plugin

[OBSOLETE] All goals migrated to scijava/scijava-maven-plugin
Other
4 stars 6 forks source link

mvn -Dimagej.app.directory=… for plugins requires _ in name #13

Closed axtimwalde closed 6 years ago

axtimwalde commented 8 years ago
mvn -Dimagej.app.directory=/home/me/Fiji.app install

for plugins that have a

<name>plugins/myPlugin.jar</name>

does not copy the target into

/home/me/Fiji.app/plugins

but into

/home/me/Fiji.app/jars

whereas

<name>plugins/my_Plugin.jar</name>

would be copied into

/home/me/Fiji.app/plugins

If I understood @rasband correctly, _ is not required any more to recognize plugins. If that is true, it should not be required by the copy rule either.

ctrueden commented 8 years ago

Note that ImageJ2 plugins actually live in jars/ along with everything else. The plugins/ folder is only necessary for ImageJ 1.x plugins.

How would you propose we differentiate if not by underscore? Look for a plugins.config file? That is also not always enough. But it might be sufficient here.

Thoughts?

axtimwalde commented 8 years ago

How about using the path specification in the name attribute? May be I do not understand enough of this. The pom.xml contains an attribute

<name>plugins/myPlugin.jar</name>

which starts with

plugins/

which is a great hint to move the file to plugins/ instead of jars/. This path is currently ignored.

hinerm commented 8 years ago

For reference, here's the code that does the check

Looks like it already is looking for a plugins.config? At a glance it's not clear to me if the pom would be readily available or not.

ctrueden commented 8 years ago

@axtimwalde I actually want to fix the names to be correct title case names for each plugin, rather than the weird filenames they are now, because they will soon be shown in a big table of core Fiji components. (See http://imagej.net/Template:ComponentTable:net.imagej:imagej for an idea of what's to come... but it will be at http://imagej.net/Template:ComponentTable:sc.fiji:fiji for the Fiji components.)

@hinerm Cool, so all we have to do is remove the prior line's check that demands an underscore, and maybe that will be good enough? @axtimwalde Do you always have a plugins.config for your plugins?

If that isn't good enough, the next step would be to check the POM for a special property (e.g., <imagej1.plugin>true</imagej1.plugin> or similar). @hinerm I do think we can access the POM via SciJava Common's org.scijava.util.POM class, which can extract it from the JAR file's META-INF/maven subfolder.

axtimwalde commented 8 years ago

@axtimwalde Do you always have a plugins.config for your plugins?

I do but others may not, e.g. with single class plugins. I think a more robust solution would be to test for _ in the filename OR plugins.config, but that's still a clumsy surrogate. It would actually have to test for if the class that is named in plugins.config or the single class in default name space implement ij.plugin.Plugin or ij.plugin.PluginFilter.

ctrueden commented 8 years ago

I think I'll go for the special property OR existence of plugins.config. In general I'd rather not assume that _ means ImageJ1 plugin. But I may not have time for awhile to address this issue.

tpietzsch commented 7 years ago

I'm just having the same issue now. Is there a solution or workaround in the meantime?

ctrueden commented 7 years ago

@tpietzsch Any chance you can simply make it implement SciJava Command instead? Then you don't need the JAR to go to plugins/ anymore, nor do you need a plugins.config.

tpietzsch commented 7 years ago

@ctrueden to be honest, I'm trying to remember where I actually had the problem... I guess manual copying solved it. I'll try implementing Command next time I'll run into it.

ctrueden commented 6 years ago

Closed in favor of scijava/scijava-maven-plugin#18.