SysML-v2-Pilot-Implementation icon indicating copy to clipboard operation
SysML-v2-Pilot-Implementation copied to clipboard

pom.xml cannot be processed by tycho-versions-pluging

Open Rots opened this issue 3 years ago • 9 comments

As suggested below, raising this as an issue.

Originally posted by @seidewitz in https://github.com/Systems-Modeling/SysML-v2-Pilot-Implementation/issues/309#issuecomment-1003191208

A demonstrator Dockerfile: https://github.com/Rots/SysML-v2-Pilot-Implementation/blob/illegal-xml/Dockerfile

Context for the issue: I'm trying to use the pilot implementation libraries as a dependency. To get the released libraries, I could pull them from the Github package repository, but for some reason GitHub package repository does not allow anonymous access to the repositories. An (at first thought easy) alternative is to just clone and build from source (and not need to authenticate). Unfortunately there is no tagged version in the repository where the packages would be with the final release versions instead of the -SNAPSHOT, so to get the release version it is necessary to run the upversioning before deploying them to our internal repository. With the environment as seen from the Dockerfile: Maven 3.6 and AdoptOpenJDK 11 the error occurs:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-versions-plugin:2.5.0:update-eclipse-metadata (default-cli) on project org.omg.sysml.parent: Execution default-cli of goal org.eclipse.tycho:tycho-versions-plugin:2.5.0:update-eclipse-metadata failed: This Pom /repo/pom.xml is in the Wrong Format: Line 217, column 50: Illegal character in attribute value: '>' -> [Help 1]

Rots avatar Jan 14 '22 21:01 Rots

It's highly likely that this problem comes from tycho-versions-plugin, which we do not use for our version management. Instead, please use set-version executed in the validate maven phase. I think -Dproject.version=VERSION command line argument to specify the release version for that.

himi avatar Jan 14 '22 22:01 himi

I simply tried mvn versions:set validate -DremoveSnapshot and the following mvn package worked properly.

himi avatar Jan 14 '22 22:01 himi

However, @seidewitz , I think we should release packages without -SNAPSHOT version.

himi avatar Jan 14 '22 22:01 himi

We do release packages without the snapshot version (see, e.g., https://github.com/Systems-Modeling/SysML-v2-Pilot-Implementation/packages/597995). The issue @Rots seems to be having is with anonymous access to the packages published in the GitHub repository.

seidewitz avatar Jan 14 '22 23:01 seidewitz

If tycho-versions-plugin is not used, the versions are not properly set for all modules, e.g. see version of SysML v2 Feature below:

$ git checkout -f 2021-12
$ mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false --batch-mode
$ mvn help:evaluate -Dexpression=project.modules
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] org.omg.sysml.parent 0.19.0 ........................ SUCCESS [  8.085 s]
[INFO] org.omg.sysml 0.19.0 ............................... SKIPPED
[INFO] org.omg.kerml.expressions.xtext 0.19.0 ............. SKIPPED
[INFO] org.omg.kerml.xtext 0.19.0 ......................... SKIPPED
[INFO] org.omg.sysml.xtext 0.19.0 ......................... SKIPPED
[INFO] org.omg.kerml.expressions.xtext.ide 0.19.0 ......... SKIPPED
[INFO] org.omg.kerml.xtext.ide 0.19.0 ..................... SKIPPED
[INFO] org.omg.sysml.xtext.ide 0.19.0 ..................... SKIPPED
[INFO] org.omg.kerml.expressions.xtext.ui 0.19.0 .......... SKIPPED
[INFO] org.omg.kerml.xtext.ui 0.19.0 ...................... SKIPPED
[INFO] org.omg.sysml.xtext.ui 0.19.0 ...................... SKIPPED
[INFO] SysML 2 PlantUML visualization 0.19.0-SNAPSHOT ..... SKIPPED
[INFO] org.omg.sysml.interactive 0.19.0 ................... SKIPPED
[INFO] org.omg.sysml.interactive.tests 0.19.0 ............. SKIPPED
[INFO] jupyter-sysml-kernel 0.19.0 ........................ SKIPPED
[INFO] jupyterlab-sysml 0.19.0 ............................ SKIPPED
[INFO] org.omg.sysml.jupyter.installer 0.19.0 ............. SKIPPED
[INFO] SysML v2 Feature 0.19.0-SNAPSHOT ................... SKIPPED
[INFO] SysML 2 PlantUML visualization for Eclipse 0.19.0-SNAPSHOT SKIPPED
[INFO] SysML v2 PlantUML Visualization Feature 0.19.0-SNAPSHOT SKIPPED
[INFO] org.omg.sysml.site 0.19.0 .......................... SKIPPED
[INFO] org.omg.kerml.xpect.tests 0.19.0 ................... SKIPPED
[INFO] org.omg.sysml.xpect.tests 0.19.0 ................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  48.664 s
[INFO] Finished at: 2022-01-28T19:56:46Z
[INFO] ------------------------------------------------------------------------

Rots avatar Jan 28 '22 20:01 Rots

It is not clear that you did mvn package to generate this result.

After the git checkout do mvn clean package, with no other options. This may fail due to incomplete version update. If so, do a mvn package, which should succeed. This is what works for the releases.

seidewitz avatar Jan 29 '22 02:01 seidewitz

The versions of the features in feature.xml are also maintained by set-version. As I said it is triggered by the validate lifecycle not versions:set, which maintains only product.version.

himi avatar Jan 29 '22 02:01 himi

Actually, this is not our problem. It should be an issue of tycho-versions-plugin, which cannot process well-formed XML. To be honest, tycho-version-plugins is error prone and I would like to avoid using it.

himi avatar Jan 29 '22 02:01 himi

@himi, sorry I missed the validation step... finally I made it work

I simply tried mvn versions:set validate -DremoveSnapshot and the following mvn package worked properly.

That doesn't work as validate makes it fail half-way with error: [ERROR] Failed to execute goal on project org.omg.kerml.expressions.xtext: Could not resolve dependencies for project org.omg.sysml:org.omg.kerml.expressions.xtext:eclipse-plugin:0.19.0-SNAPSHOT: Could not find artifact org.omg.sysml:org.omg.sysml:jar:0.19.0-SNAPSHOT -> [Help 1]

After the git checkout do mvn clean package, with no other options. This may fail due to incomplete version update. If so, do a mvn package, which should succeed. This is what works for the releases.

The versions need to be updated to non -SNAPSHOT ones, none of these steps do that.

So what worked was:

$ mvn versions:set validate -DremoveSnapshot # without any other targets as these would likely make it fail as the version update is incomplete at this stage

$ mvn package validate # validate depends on the package phase; succeeds, but produced some wrong artifacts still... ignore those
$ ls -la org.omg.sysml.feature/target/*.jar
-rw-r--r-- 1 root root 1607 Feb  2 21:54 org.omg.sysml.feature/target/org.omg.sysml.feature-0.19.0-SNAPSHOT.jar
-rw-r--r-- 1 root root 3013 Feb  2 21:54 org.omg.sysml.feature/target/org.omg.sysml.feature-0.19.0-SNAPSHOT-sources-feature.jar

$ mvn package # only now after the validation above is run, the workspace is in a good state (i.e. mvn package produces artifacts without the `-SNAPSHOT` qualifier)

$ ls -la org.omg.sysml.feature/target/*.jar
-rw-r--r-- 1 root root 1594 Feb  2 21:58 org.omg.sysml.feature/target/org.omg.sysml.feature-0.19.0.jar
-rw-r--r-- 1 root root 1607 Feb  2 21:54 org.omg.sysml.feature/target/org.omg.sysml.feature-0.19.0-SNAPSHOT.jar
-rw-r--r-- 1 root root 3013 Feb  2 21:54 org.omg.sysml.feature/target/org.omg.sysml.feature-0.19.0-SNAPSHOT-sources-feature.jar
-rw-r--r-- 1 root root 2989 Feb  2 21:58 org.omg.sysml.feature/target/org.omg.sysml.feature-0.19.0-sources-feature.jar

Another odd thing is that the revision property in the main pom.xml is never updated as part of the above steps. Is this not used anywhere?

Rots avatar Feb 02 '22 22:02 Rots

@Rots @himi

Can this issue be closed?

seidewitz avatar Sep 06 '22 14:09 seidewitz