scijava / scijava-search

Search framework for SciJava applications :mag:
BSD 2-Clause "Simplified" License
2 stars 2 forks source link

SourceFinder returns wrong URLs for original ImageJ classes #22

Closed imagejan closed 2 years ago

imagejan commented 2 years ago

Since the deprecation of ImageJA and the changes to imagej/ImageJ to be able to build with Maven, the Source button returns a 404 page for all original ImageJ menu items (i.e. all ij.* classes).

I guess that we'd somehow teach SourceFinder to respect these lines in the target POM:

                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <includes>ij/**</includes>
                </configuration>

https://github.com/imagej/ImageJ/blob/eb466f8a0a73a1f9bffec19bd9b3176d220a8896/pom.xml#L200-L203

/cc @ctrueden @hinerm

ctrueden commented 2 years ago

Thanks for the heads up, @imagejan. The primary line of concern is this one:

https://github.com/imagej/ImageJ/blob/eb466f8a0a73a1f9bffec19bd9b3176d220a8896/pom.xml#L112

We can just check the POM for a sourceDirectory under properties, and use that instead of src/main/java if present.

imagejan commented 2 years ago

@ctrueden thanks for the pointers.

pom.cdata("//build/sourceDirectory") for the ij artifact returns ${project.basedir} literally. Do you have a suggestion how I get at the property value?

ctrueden commented 2 years ago

I don't believe basedir is something anyone can or should be overriding in their POM. Therefore, ${project.basedir} can always be treated as / (or empty string, depending exactly how things are coded) for the GitHub repository path prefix—at least for single-module projects. (We can worry about multi-module projects some day later, but if you want to be thorough, the only one we have currently is https://github.com/axtimwalde/mpicbg.)