Mwe2Launcher - Couldn't find module

1.4k views Asked by At

I constantly get:

mf.mwe2.launch.runtime.Mwe2Launcher  - Couldn't find module x

error though the x.mwe2 file exists. I have enabled the xtext nature to the project and added related modules.

here's the .mwe2 file:

module com.ford.modelling.workflow.abcd

Workflow {
    component = SayHello {
        message = "hello"
    }   
}

What might be the problem? (a folder named src-gen already exists)

3

There are 3 answers

0
Aykut Kllic On

OK. I've found the problem (though not a solution yet).

Enabling scala nature halts the build process of MWE2. Can't figure out why but this is what happens. I remove the Scala nature and everything works.

1
Christian Dietrich On

please make sure that the mwe2 file is placed in a java source folder and that you did a clean build on the project the mwe2 file is contained.

0
franz On

Had the same problem. The exception however occurs in the Mwe2Runner, not the Mwe2Launcher. The Mwe2Runner tried to load the mwe2 file as a resource and produces that error if it can't find it, although the Mwe2Launcher can.

Anyway, solution is to register your src-dir as a resource-dir by adding the following to your pom.xml

<build>
...
<resources>
  <resource>
    <directory>src</directory>
    <excludes>
      <exclude>**/*.java</exclude>
    </excludes>
  </resource>
</resources>
...
</build>