Commit f268330
Tweak SciJava plugin metadata aggregation hack
Generally speaking, it is not correct to mix the contents of
target/classes/META-INF/org.scijava.plugin.Plugin into
target/test-classes/META-INF/org.scijava.plugin.Plugin, because it
creates duplicate plugin entries across the two classpath elements.
The reason for the script-maven-plugin hack is to avoid module-path
woes, where (if I understand correctly) the target/classes
directory is on the module path but the target/test-classes
directory is on the classpath, which somehow results in the unit
tests not being able to discover plugins in the target/classes
folder, even though the src/main/java/module-info.java includes
e.g. `opens org.scijava.persist to org.scijava`. And similarly for
SciJava Ops, not being able to notice the `target/classes/ops.yaml`
from unit tests. This is an unfortunate situation, which we have
tried to resolve by introducing a `src/test/java/module-info.java`
as well, but have never quite been able to make it work correctly.
Strangely, the scijava-ops-benchmark component introduces a single
`@Plugin` of type `net.imagej.ops.Op` in its main scope, which as
per the script hack gets propagated into both target/classes and
target/test-classes... but then the unit tests *do* see both of
these files and read them both, resulting in an ImageJ Ops
environment containing that Op plugin twice, which results in the
dreaded "Multiple ops of priority 0.0" error.
I do not understand why the behavior differs between modules.
Nonetheless, this commit seeks to avoid the issue by only combining
META-INF/org.scijava.plugin.Plugin metadata files between
target/classes and target/test-classes for the one component that
actually needs it, which is scijava-persist.1 parent d7b0327 commit f268330
2 files changed
+60
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
116 | 175 | | |
117 | 176 | | |
118 | 177 | | |
| |||
0 commit comments