da-nrw / DNSCore

The Core System of the DA-NRW Software Suite.
www.danrw.de
GNU General Public License v3.0
8 stars 14 forks source link

mvn install in DNSCore/SIP-Builder bricht mit BUILD Failure ab #34

Open Possommi opened 4 years ago

Possommi commented 4 years ago

Fehlermeldung:

[ERROR] Failed to execute goal on project SipBuilder: Could not resolve dependencies for project de.uzk.hki.da:SipBuilder:jar:1.0-SNAPSHOT: Failed to collect dependencies at gov.loc:bagit:jar:4.8: Failed to read artifact descriptor for gov.loc:bagit:jar:4.8: Could not transfer artifact gov.loc:bagit:pom:4.8 from/to central (http://repo1.maven.org/maven2): Failed to transfer file http://repo1.maven.org/maven2/gov/loc/bagit/4.8/bagit-4.8.pom with status code 501 -> [Help 1] [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/DependencyResolutionException

trebunski commented 4 years ago

Danke, dies liegt an der Deaktivierung des HTTP-Zuganges zu dem Maven-Central-Server (https://stackoverflow.com/questions/59763531/maven-dependencies-are-failing-with-a-501-error )

Es sollte jetzt funktionieren.

Possommi commented 4 years ago

Ursprüngliche Fehlermeldung kommt nun nicht mehr, dafür bricht der Build mit von DNSCommon mit

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project DNSCommon: Compilation failure: Compilation failure: [ERROR] Source option 5 is no longer supported. Use 7 or later. [ERROR] Target option 5 is no longer supported. Use 7 or later.

ab.

trebunski commented 4 years ago

Wir können es momentan nicht reproduzieren. Welche JDK- und Maven-Version nutzen Sie und wie Compilieren Sie ( Befehle).

Beim Überfliegen der pom.xml vom ContentBroker (https://github.com/da-nrw/DNSCore/blob/master/ContentBroker/pom.xml ) ist ein Bereich aufgefallen, evntl. löst es das Ihr Problem, leider können wir den Fehler nicht reproduzieren:

<configuration>
    <configuration> 
                <source>1.8</source> 
               <target>1.8</target> 
       </configuration> 
</configuration>

Es ist wahrscheinlich halb richtig, dass hier die 'configuration' in 'configuration' verschachtelt ist. Versuchen Sie ohne doppelt Verschachtelung in der pom.xml nochmal zu bauen.

Possommi commented 4 years ago

das Problem ist offenbar die fehlende Angabe der source und target Elemente. in DNSCore/pom.xml. Dadurch wird offenbar 1.5 oder 1.6 als Standardversion gesetzt, was dann zu dem oben beschriebenen Problem führt:

          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
          </configuration>

Ich verwende openjdk version "13.0.1" 2019-10-15 und maven 3.6.2

Possommi commented 4 years ago

nachdem nun DNSCore/DNSCommon gebaut werden konnte schlägt ein

mvn clean && mvn verify in DNSCore/ContentBroker wie folgt fehlt:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for de.uzk.hki.da:ContentBroker:jar:SNAPSHOT
[WARNING] 'version' uses an unsupported snapshot version format, should be '*-SNAPSHOT' instead. @ line 7, column 11
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] --------------------< de.uzk.hki.da:ContentBroker >---------------------
[INFO] Building DA-NRW Content Broker SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.apache.qpid:proton-jms:jar:0.3.0-fuse-2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.444 s
[INFO] Finished at: 2020-04-14T08:25:11+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ContentBroker: Could not resolve dependencies for project de.uzk.hki.da:ContentBroker:jar:SNAPSHOT: Failed to collect dependencies at de.uzk.hki.da:DNSCommon:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for de.uzk.hki.da:DNSCommon:jar:1.0-SNAPSHOT: Failure to find de.uzk.hki.da:DNSCore:pom:1.0-SNAPSHOT in http://insecure.repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of HTTPRep has elapsed or updates are forced -> [Help 1]
[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/DependencyResolutionException
gabender commented 4 years ago

Ich habe nun ebenfalls openjdk Version 13.0.1 installiert. Leider kann ich den Fehler nicht reproduzieren. Mir scheint aber, dass folgende Dateien im .m2/repository fehlen

.m2/repository/de/uzk/hki/da/DNSCore/1.0-SNAPSHOT/DNSCore-1.0-SNAPSHOT.pom

.m2/repository/de/uzk/hki/da/DNSCommon/1.0-SNAPSHOT/DNSCommon-1.0-SNAPSHOT.jar

.m2/repository/de/uzk/hki/da/DNSCommon/1.0-SNAPSHOT/DNSCommon-1.0-SNAPSHOT.jpom

Um die Datei in DNSCommon zu erzeugen kann man im Verzeichnis DNSCommon

mvn install

ausführen und anschließend ein

mvn install

im Ordenr DNSCore. Falls hier nur DNSCore gebaut werden soll, so kann man in der pom.xml unter modules die restlichen Mudule aus kommentieren.

Possommi commented 4 years ago

Damit man DNSCommon überhaupt bauen kann, muss man in DNSCore/pom.xml das maven-compiler-plugin konfigurieren:

`

org.apache.maven.plugins
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <source>7</source>
        <target>7</target>
      </configuration>
    </plugin>`

Den SIP-Builder kann ich nun bauen: dafür habe ich in SIP-Builder/pom.xml beim maven-compiler-plugin die Versionsnummer herausgenommen und source und target auf 7 gesetzt.

`

maven-compiler-plugin
    <configuration>
      <source>7</source>
      <target>7</target>
      <encoding>UTF-8</encoding>
    </configuration>
  </plugin>`

Der SipBuilder (DNSCore/SIP-Builder/target/installation) lässt sich dann allerdings nicht starten Folgende Meldung erscheint:

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance. Exception in thread "main" java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found. at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:576) at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:601) at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:588) at de.uzk.hki.da.metadata.ContractRights.<init>(ContractRights.java:52) at de.uzk.hki.da.sb.SIPFactory.<init>(SIPFactory.java:82) at de.uzk.hki.da.gui.Gui.<init>(Gui.java:93) at de.uzk.hki.da.main.SIPBuilder.startGUIMode(SIPBuilder.java:125) at de.uzk.hki.da.main.SIPBuilder.main(SIPBuilder.java:101)

Ich habe jetzt auch noch mal auf einer CentOS 7.7 Maschine getestet und openjdk version "11.0.2" 2019-01-15 um auszuschließen, dass es ein macos-Problem ist.

DNSCommon lässt sich auch hier ohne Änderungen in den poms nicht bauen.

gabender commented 4 years ago

Die Änderungen der poms werden ab Java Version 9 benötigt. Damit der SIP-Builder funktioniert muss die pom des SIP-Builders noch um die Zeile true ergänzt werden:

<plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
            <archive>
                <manifestEntries>
                    <buildNumber>${env.BUILD_NUMBER}</buildNumber>
                    **<Multi-Release>true</Multi-Release>**
                </manifestEntries>
                <manifest>
                    <mainClass>de.uzk.hki.da.main.SIPBuilder</mainClass>
                </manifest>
            </archive>