TLA-FLAT / FLAT

GNU General Public License v3.0
16 stars 4 forks source link

dans-scala-prototype #18

Closed fjohan closed 5 years ago

fjohan commented 5 years ago

Hi, trying to build the FLAT docker image.

When running:

docker build --squash -t flat add-sword-to-flat/

the build stops with this error:

Step 6/17 : RUN cd /tmp/easy-deposit && mvn clean install && cp target/easy-deposit.war /var/www/fedora/tomcat/webapps/easy-deposit.war && mkdir /var/www/fedora/tomcat/webapps/easy-deposit && cd /var/www/fedora/tomcat/webapps/easy-deposit/ && unzip ../easy-deposit.war && rm -r /tmp/easy-deposit ---> Running in 3938dbdeaf74 [INFO] Scanning for projects... Downloading: http://maven.dans.knaw.nl/nl/knaw/dans/shared/dans-scala-prototype/1.17/dans-scala-prototype-1.17.pom Downloading: https://repo.maven.apache.org/maven2/nl/knaw/dans/shared/dans-scala-prototype/1.17/dans-scala-prototype-1.17.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for nl.knaw.dans.easy:easy-deposit:1.0.2: Could not find artifact nl.knaw.dans.shared:dans-scala-prototype:pom:1.17 in DANS (http://maven.dans.knaw.nl/) and 'parent.relativePath' points at wrong local POM @ line 21, column 12 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR]
[ERROR] The project nl.knaw.dans.easy:easy-deposit:1.0.2 (/tmp/easy-deposit/pom.xml) has 1 error [ERROR] Non-resolvable parent POM for nl.knaw.dans.easy:easy-deposit:1.0.2: Could not find artifact nl.knaw.dans.shared:dans-scala-prototype:pom:1.17 in DANS (http://maven.dans.knaw.nl/) and 'parent.relativePath' points at wrong local POM @ line 21, column 12 -> [Help 2] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException The command '/bin/sh -c cd /tmp/easy-deposit && mvn clean install && cp target/easy-deposit.war /var/www/fedora/tomcat/webapps/easy-deposit.war && mkdir /var/www/fedora/tomcat/webapps/easy-deposit && cd /var/www/fedora/tomcat/webapps/easy-deposit/ && unzip ../easy-deposit.war && rm -r /tmp/easy-deposit' returned a non-zero code: 1

Thanks

pautri commented 5 years ago

Hi Johan, it looks like the maven repository at DANS is currently not available and the artifact is not available from the central repository either. I will contact them.

janvanmansum commented 5 years ago

@pautri : We have changed the public access URL slightly. It is now: https://maven.dans.knaw.nl/releases/ (Don't worry if you see that you cannot browse the contents of this repo; that is intentional. You should still be able to GET artifacts by exact coordinates.)

Also, we have migrated from Artifactory to Nexus, and left some legacy artifacts unmigrated. However, now I have copied all the easy-deposit and dans-scala-prototype versions I could find. Please, let me know if there are any other dependencies that you need.

fjohan commented 5 years ago

Thanks, changing to https://maven.dans.knaw.nl/releases/ lets it download dans-scala-prototype-1.17.pom

Now there's a new error (missing dependency?) when it tries to build easy-deposit:

[ERROR] Failed to execute goal on project easy-deposit: Could not resolve dependencies for project nl.knaw.dans.easy:easy-deposit:war:1.0.2: Could not find artifact nl.knaw.dans.easy:easy-sword2-lib:jar:1.0-beta-2 in DANS (https://maven.dans.knaw.nl/releases/) -> [Help 1]

pautri commented 5 years ago

@fjohan I was able to run the add-sword-to-flat Dockerfile without modifying it, so with the original maven URL replacement as it was. Btw, we need to swap out Oracle Java with OpenJDK in the main FLAT Dockerfile, but given that you got this far I assume you already figured that out.

fjohan commented 5 years ago

Yes, I have switched to openjdk-8-jdk.

Still problems with add-sword-to-flat, though. I have to use the 'releases' URL.

As an experiment, I added the following

sed -i 's|1.0-beta-2|1.1.1|g' pom.xml

which gets me past the 'easy-sword2-lib' above.

But then:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack (default) on project easy-deposit: Unable to find artifact. Could not find artifact nl.knaw.dans.shared:dans-build-resources:jar:1.2 in DANS (https://maven.dans.knaw.nl/releases/)

pautri commented 5 years ago

that is kind of strange, for me it worked fine. Did you try this on a FLAT base image that was built from scratch? Perhaps there is some caching going on.

fjohan commented 5 years ago

Yes, this is built from scratch. I think maven caches stuff in a folder .m2

Wild guess, but is it possible that you have the artifacts I am missing in there somewhere?

pautri commented 5 years ago

indeed there was some caching going on at my end, I now also get an error if I only change the maven URL to the new one:

[ERROR] Failed to execute goal on project easy-deposit: Could not resolve dependencies for project nl.knaw.dans.easy:easy-deposit:war:1.0.2: Could not find artifact nl.knaw.dans.easy:easy-sword2-lib:jar:1.0-beta-2 in DANS (https://maven.dans.knaw.nl/releases/) -> [Help 1]

we should probably move to a newer version of easy-deposit (now called easy-sword2) anyway, but perhaps @janvanmansum could have a look at what's missing if it's not too much trouble

fjohan commented 5 years ago

That's a nice find!

I got it working now. First compiling dans-parent (an old version which contains target dans-build-resources 1.2) and then I added the dans-build-resources-1.2.jar to the easy_deposit dir and then it let me build easy_deposit.war

So add-sword-to-flat at least runs to completion now. But it's really hacky, easy-sword2 might be better in the long run.