european-commission-empl / european-digital-credentials

European Union Public License 1.2
5 stars 3 forks source link

Missing dependencies during compilation of root `pom.xml` #4

Open SeSodesa opened 3 years ago

SeSodesa commented 3 years ago

After making the suggested change to the workbook tests mentioned in issue #3, the tests proceed further, but still fail. This time progress is made as far as

[INFO] Reactor Summary:
[INFO] 
[INFO] edci-commons 2.0 ................................... SUCCESS [ 12.217 s]
[INFO] edci-dss-utils 1.0 ................................. SUCCESS [  0.538 s]
[INFO] edci 1.3.0-SNAPSHOT ................................ SUCCESS [  0.068 s]
[INFO] edci-issuer 1.3.0-SNAPSHOT ......................... SUCCESS [  0.133 s]
[INFO] EDCI issuer common module 1.3.0-SNAPSHOT ........... SUCCESS [  0.783 s]
[INFO] EDCI issuer persistence module 1.3.0-SNAPSHOT ...... SUCCESS [  5.499 s]
[INFO] EDCI issuer service module 1.3.0-SNAPSHOT .......... SUCCESS [01:50 min]
[INFO] EDCI issuer web REST swagger generator module 1.3.0-SNAPSHOT SUCCESS [  0.337 s]
[INFO] EDCI issuer REST module 1.3.0-SNAPSHOT ............. SUCCESS [ 40.276 s]
[INFO] EDCI issuer web module 1.3.0-SNAPSHOT .............. FAILURE [  0.090 s]

This time the error is related to a missing dependency:

[ERROR] Failed to execute goal on project edci-issuer-web: Could not resolve dependencies for project eu.europa.ec.empl.edci.issuer:edci-issuer-web:war:1.3.0-SNAPSHOT: Failed to collect dependencies at eu.europa.ec.digit.uxatec.eui:eui-angular2-servlet:jar: 1.0.0: Failed to read artifact descriptor for eu.europa.ec.digit.uxatec.eui: eui-angular2-servlet:jar:1.0.0: Could not transfer artifact eu.europa.ec.digit.uxatec.eui: eui-angular2-servlet:pom:1.0.0 from/to local (/home/santtu/.m2/repository): Cannot access /home/santtu/.m2/repository with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access /home/santtu/.m2/repository using the registered transporter factories: WagonTransporterFactory: Unsupported transport protocol -> [Help 1]

I am guessing this is related to an entirely missing dependency declaration in my settings.xml file. Currently the file has the following contents:

<?xml version="1.0" encoding="UTF-8"?>

<settings
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xsi:schemaLocation="
        http://maven.apache.org/SETTINGS/1.0.0
        http://maven.apache.org/xsd/settings-1.0.0.xsd
    "
>

    <localRepository>${user.home}/.m2/repository</localRepository>

    <pluginGroups>
        <pluginGroup>org.jacoco</pluginGroup>
    </pluginGroups>

    <proxies>
    </proxies>

    <servers>
    </servers>

    <mirrors>
    </mirrors>

    <profiles>

        <profile>

            <id>external</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <property>
                    <name>env.USERDOMAIN</name>
                    <value>NET1</value>
                </property>
            </activation>

            <repositories>

                <repository>
                    <id>Red Hat</id>
                    <url>https://maven.repository.redhat.com/ga/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>

                <repository>
                    <id>cronapp</id>
                    <url>https://artifactory.cronapp.io/public-release/</url>
                </repository>

                <repository>
                    <id>nexus-ec</id>
                    <url>http://central.maven.org/maven2/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>

                <repository>
                    <id>joinup-dss-thirdparty</id>
                    <url>http://joinup.ec.europa.eu/site/sd-dss/maven2</url>
                </repository>

                <repository>
                    <id>joinup</id>
                    <name>Joinup</name>
                    <url>https://joinup.ec.europa.eu/nexus/content/groups/public/</url>
                </repository>

                <repository>
                    <id>cefdigital</id>
                    <name>cefdigital</name>
                    <url>https://ec.europa.eu/cefdigital/artifact/content/repositories/esignaturedss/</url>
                </repository>

            </repositories>

            <pluginRepositories>

                <pluginRepository>
                    <id>Red Hat</id>
                    <url>https://maven.repository.redhat.com/ga/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </pluginRepository>

                <pluginRepository>
                    <id>cronapp</id>
                    <url>https://artifactory.cronapp.io/public-release/</url>
                </pluginRepository>

                <pluginRepository>
                    <id>Central</id>
                    <url>http://central.maven.org/maven2/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>

            </pluginRepositories>

        </profile>

        <profile>

            <id>local-repo</id>
            <repositories>
                <repository>
                    <id>local</id>
                    <name>Local</name>
                    <url>${user.home}/.m2/repository</url>
                </repository>
            </repositories>

        </profile>

    </profiles>

    <activeProfiles>
        <activeProfile>external</activeProfile>
        <activeProfile>local-repo</activeProfile>
    </activeProfiles>

</settings>

I ran into a similar issue when trying to compile the edci-viewer as well, with only edci-commons and edci-dss-utils compiled. Where can a comprehensive list of all the dependencies of the project and their sources be found? The documentation should be fixed to make the compilation possible without reading the source code. A simple

npm install --also=dev && npm build-*

on top of

mvn clean install -e

in the suggested necessary folders does not seem to do the trick.

SeSodesa commented 3 years ago

Looks like the offending dependency eui-angular2-servlet:jar:1.0.0 is located in the folder

configuration/external-libs

and can be installed to the local Maven repository with the command

mvn install:install-file \       
    -Dfile=configuration/external-libs/eui-angular2-servlet-1.0.0.jar \
    -DgroupId=eu.europa.ec.digit.uxatec.eui \
    -DartifactId=eui-angular2-servlet \
    -Dversion=1.0.0 \
    -Dpackaging=jar

More generally, locally situated third party libraries can be installed according to these instructions. This should be mentioned in the documentation.

Esayos commented 2 years ago

Hi @SeSodesa , we will include a new maven settings in the next version with a repository were this library should be available, that should fix the issue and manual installation will not be required. Just in case, as this is a 3rd party artifact, it will still be included in the configuration folder.