Open jodygarnett opened 4 years ago
I can look into this - is this based on the latest geonetwork core master? and the HNAP 3.10.x branch?
What parameters did you pass when you called add-schema.sh?
I used the default example from add-schema.sh
:
./add-schema.sh iso19139.ca.HNAP https://github.com/metadata101/iso19139.ca.HNAP 3.11.x
See https://github.com/geonetwork/core-geonetwork/issues/4914 for context
@jodygarnett
Sorry - did not have much time to test.
I quickly did the following
I checkout the master from geonetwork core then run
./add-schema.sh iso19139.ca.HNAP https://github.com/metadata101/iso19139.ca.HNAP 3.11.x
And then run
mvn clean install
I get the following error.
[ERROR] Failed to execute goal on project services: Could not resolve dependencies for project org.geonetwork-opensource:services:jar:3.11.0-SNAPSHOT: Could not find artifact org.geonetwork-opensource:schema-iso19139.ca.HNAP:jar:3.11.0-SNAPSHOT -> [Help 1]
I noticed that you changed the group for the schema to org.geonetwork-opensource.schemas. Not sure if add-schema.sh also has to use this for the service module.
@jodygarnett In service pom.xml, I changed the group to org.geonetwork-opensource.schemas and I no longer get that error. But now I get the following error.
[ERROR] testCollectGraphicOverviewEntries(org.fao.geonet.api.directory.DirectoryApiTest) Time elapsed: 0.042 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 10 in XML document from URL [jar:file:/u01/geonetwork_build/core-geonetwork/schemas/iso19139.ca.HNAP/target/schema-iso19139.ca.HNAP-3.11.0-SNAPSHOT.jar!/config-spring-geonetwork.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 75; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'.
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'.
When I compare version 3.11.x version of config-spring-geonetwork.xml https://github.com/metadata101/iso19139.ca.HNAP/blob/3.11.x/src/main/resources/config-spring-geonetwork.xml with version 3.10.x https://github.com/metadata101/iso19139.ca.HNAP/blob/3.10.x/src/main/resources/config-spring-geonetwork.xml I can see that the xsi:schemaLocation is missing the context.
I'm not sure why this would be different in 3.11.x. Makes me wonder if there are other difference between 3.10.x and 3.11.x that could cause issues.
Thanks for detecting the schema plugin change, I expect that is a needed change to add-schema.sh
script.
As for the new failure ... can we recreate master
(formally 3.11.x
) from the existing 3.10.x and make the appropriate pom.xml changes. I am not sure how well hnap schema plugin has been maintained with respect to compatibility with master...
It may be wise to set up a jenkins build job to continually test core-geonetwork master
and hnap master
so we can be notified of any breaking changes early.
I don't believe master has been used so I don't have any objection with it being recreated from 3.10.x
@ianwallen you recently added a snippet to
add-schema.sh
to help address this, it seems to no longer be working: