eclipse / xtext-eclipse

xtext-eclipse
Eclipse Public License 2.0
49 stars 80 forks source link

Tycho tries to resolve Xtext 2.20 #1206

Closed MarkusAmshove closed 4 years ago

MarkusAmshove commented 4 years ago

Hi,

I'm currently trying to repair a build for a Xtext based project which uses Tycho to create the plugins and an update site, which I then deploy to Artifactory.

We're working behind a corporate proxy which means we need Artifactory as a repository aggregator, because the workstations and build servers can't access things like mavencentral, download.eclipse.org etc.

I'm trying to update a Xtext project which was untouched for quite some while from 2.17 to 2.19, as I'll have to work on this again. I started by creating a new one and merging the poms with the original project. They are now identical (aside from package/projectnames).

I've also consolidated the MANIFEST.MF files to match the versions of the newly created 2.19 project.

My local build with mvn verify now works fine, but in CI it breaks with:

[INFO] Resolving dependencies of MavenProject: net.aokv.formeldsl:net.aokv.formeldsl:3.1.0-SNAPSHOT @ E:\data\agent\workspace\Xtext_FormelDsl_28188\src\net.aokv.formeldsl\pom.xml

[ERROR] The following artifacts could not be downloaded: 
[ERROR]   osgi.bundle,org.eclipse.emf.mwe.core,1.5.1.201910080515
[ERROR]   osgi.bundle,org.eclipse.emf.mwe.utils,1.5.1.201910080515
[ERROR]   osgi.bundle,org.eclipse.emf.mwe2.lib,2.11.1.201910080515
[ERROR]   osgi.bundle,org.eclipse.emf.mwe2.runtime,2.11.1.201910080515
[ERROR]   osgi.bundle,org.eclipse.xtend.lib,2.20.0.v20190928-1035
[ERROR]   osgi.bundle,org.eclipse.xtend.lib.macro,2.20.0.v20190928-1035
[ERROR]   osgi.bundle,org.eclipse.xtext,2.20.0.v20190930-0723
[ERROR]   osgi.bundle,org.eclipse.xtext.common.types,2.20.0.v20190928-1058
[ERROR]   osgi.bundle,org.eclipse.xtext.util,2.20.0.v20190930-0723
[ERROR]   osgi.bundle,org.eclipse.xtext.xbase,2.20.0.v20190928-1058
[ERROR]   osgi.bundle,org.eclipse.xtext.xbase.lib,2.20.0.v20190928-1035

This is my target definition:

<target name="net.aokv.formeldsl.target" sequenceNumber="1">
    <locations>
        <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
            <unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
            <unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
            <unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
            <unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
            <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
            <unit id="org.eclipse.jgit" version="0.0.0" />
            <repository location="http://ourartifactory/eclipse-201909"/>
        </location>
        <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
            <unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>
            <repository location="http://ourartifactory/xtext-composite"/>
        </location>
        <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
            <unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
            <repository location="http://ourartifactory/xtext-composite"/>
        </location>
        <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
            <unit id="com.google.gson" version="2.8.2.v20180104-1110"/>
            <unit id="org.antlr.runtime" version="3.2.0.v201101311130"/>
            <unit id="org.junit" version="4.12.0.v201504281640"/>
            <unit id="org.junit.jupiter.api" version="5.5.1.v20190826-0900"/>
            <unit id="org.junit.jupiter.engine" version="5.5.1.v20190826-0900"/>
            <unit id="org.junit.platform.commons" version="1.5.1.v20190826-0900"/>
            <unit id="org.junit.platform.engine" version="1.5.1.v20190826-0900"/>
            <unit id="org.junit.platform.launcher" version="1.5.1.v20190826-0900"/>
            <unit id="org.junit.platform.runner" version="1.5.1.v20190826-0900"/>
            <unit id="org.opentest4j" version="1.2.0.v20190826-0900"/>
            <unit id="org.objectweb.asm" version="7.1.0.v20190412-2143"/>
            <unit id="org.objectweb.asm.tree" version="7.1.0.v20190412-2143"/>
            <unit id="io.github.classgraph" version="4.8.35.v20190528-1517"/>
            <repository location="http://ourartifactory/orbit-201909"/>
        </location>
    </locations>
</target>

I think the names of the repositories speak for themselfes. The xtext-composite repository points to http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/

I'm not really sure why the CI build is trying to resolve 2.20, as it shows up nowhere except for the error

[INFO] Fetching p2.index from http://ourartifactory/xtext-composite/download.eclipse.org/modeling/tmf/xtext/updates/releases/xpand/ (134B)
[INFO] Fetching p2.index from http://ourartifactory/xtext-composite/download.eclipse.org/modeling/tmf/xtext/updates/releases/xpand/ (134B)
[INFO] Fetching p2.index from http://ourartifactory/xtext-composite/download.eclipse.org/modeling/emf/emf/builds/release/2.19/ (172B)
[INFO] Fetching p2.index from http://ourartifactory/xtext-composite/download.eclipse.org/modeling/emf/emf/builds/release/2.19/ (172B)
[INFO] Fetching p2.index from http://ourartifactory/xtext-composite/download.eclipse.org/modeling/emf/emf/builds/release/2.18/ (172B)
[INFO] Fetching p2.index from http://ourartifactory/xtext-composite/download.eclipse.org/modeling/emf/emf/builds/release/2.18/ (172B)
[INFO] Fetching p2.index from http://ourartifactory/xtext-composite/download.eclipse.org/modeling/emf/emf/builds/release/2.17/ (172B)

The same happens when I'm trying to use a former version (e.g. 2.18, 2.17, 2.16, ...)

I've also tried to "pin" all bundle dependencies of xtend.lib to 2.19 in the MANIFEST.MF files, but the build was still looking for 2.20.

Any advice/guidance on how to resolve this?

cdietrich commented 4 years ago

where does the try for 2.20 / mwe 2.11.1 come from do you use nightlies? do you use repo type p2 in poms too?

cdietrich commented 4 years ago

you may also try to specify an explict maven repo location on server and local

-Dmaven.repo.local=somedir as well as telling tycho to ignore local things -Dtycho.localArtifacts=ignore

MarkusAmshove commented 4 years ago

I've removed the p2 repositories from the poms in the update from 2.17 -> 2.19, because the generated new project from 2.19 doesn't contain them anymore (only the "disable codehaus-snapshots"). Should I readd them?

The repositories from the target definition point to http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ and tycho doesn't seem to fetch 2.20 (according to the logs).

I've just tried localArtifacts=ignore, which didn't help

kthoms commented 4 years ago

Please check your Artifactory. Would the same error occur without the Artifactory proxy and direct usage of the official p2 repos?

cdietrich commented 4 years ago

are you sure this stems from tycho and not maven deps?

MarkusAmshove commented 4 years ago

I've consolidated the parent projects pom against the newly generated again and found another difference which fixed the issue.

The fix was to bump maven-clean-plugin from 2.5 to 3.1.0.

Do you have any idea why this could be related to the versioning?

This is what Jenkins calls: mvn -Dtycho.localArtifacts=ignore -B verify

cdietrich commented 4 years ago

no i dont

kthoms commented 4 years ago

No idea.