Community
Participate
Working Groups
Build Identifier: 2.0.0 + fix for 352450 If i read a simple xtend2 file with a workflow using the Reader component, this does not work if i use src as path for the reader: 0 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems running workflow Test: Validation problems: 1 error: Test.xtend - C:\ba_dev81\guidsl_ws_113xxxx\test\src\test\Test.xtend 1: The declared package 'test' does not match the expected package java.lang.RuntimeException: Problems running workflow Test: Validation problems: 1 error: Test.xtend - C:\ba_dev81\guidsl_ws_113xxxx\test\src\test\Test.xtend 1: The declared package 'test' does not match the expected package at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:99) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74) at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35) Caused by: org.eclipse.emf.mwe.core.WorkflowInterruptedException: Validation problems: this is cause the validator expects the xtend files to be read from the bin directory. so if i change the workflow to Workflow { component = org.eclipse.xtext.mwe.Reader { path = "bin" uriFilter = org.eclipse.xtext.mwe.NameBasedFilter { extension = "xtend" } register = org.eclipse.xtext.xtend2.Xtend2StandaloneSetup {} loadResource = { slot = "model" } } } it does work. i an standalone scdenario i'd expect to be the root of path to be the root of the uri to check against as default package. Reproducible: Always
The validation proves if the defined package is equal to a part of a normalized classpathURI. At Runtme the classpathURI points to the file in the bin folder and not to the one in the src folder. For that reason you should use the bin folder to read the xtend-Files. Then the validation does not fail. In the IDE the classpathURI points to the file in the src folder so we do not have this problem in the IDE. If this solves your problem please let me know so that we can close this bug.
Hi, as said before: yes using the bin folder solves the problem, but this is ugly since in a standalone build i'd have to copy my xtend classes to the/a bin folder just to workarround this problem. ~Christian
I consider this also as ugly workaround. Usually the Xtend files are meant to be colocated in the source path along with Java files. In a Standalone environment this should work without the requirement to copy files before being able to compile them.
I just came across a variation of this problem: my project is configured using Maven and I saw "The declared package 'foo' does not match the expected package" BECAUSE the xtend files were copied to target/classes. Only the copy was flagged with the error (reporting errors against derived files is strange anyway). Copying happened because in my pom I had <build> <resources> <resource> <directory>${project.build.sourceDirectory}</directory> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> </build> The problem was resolved by adding: <exclude>**/*.xtend</exclude> OTOH, in my scenario the problem was not flagged by the MweReader but within the IDE, I assume by the Xtend builder. I hope this observation helps to find a solution that makes all components / builders happy.
I moved the mentioned validation to the UI-only validator.
Requested via bug 522520. -M.