Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
org.eclipse.xtext.resource.FileNotFoundOnClasspathException:canned';在类路径上找不到资源。URI为';类路径:/../Less.xtext';_Eclipse_Maven_Xtext_Tycho_Xtend - Fatal编程技术网

org.eclipse.xtext.resource.FileNotFoundOnClasspathException:canned';在类路径上找不到资源。URI为';类路径:/../Less.xtext';

org.eclipse.xtext.resource.FileNotFoundOnClasspathException:canned';在类路径上找不到资源。URI为';类路径:/../Less.xtext';,eclipse,maven,xtext,tycho,xtend,Eclipse,Maven,Xtext,Tycho,Xtend,在尝试mavenize时遇到了问题 在#208中添加了提交 我知道这是一个迟到的答复,但我遇到了同样的问题,花了一些时间找到问题的根源 错误消息实际上指向**.mwe2文件中的语法 eclipse创建的默认语法是: “类路径:/…/Less.xtext” mavenized项目后,grammarURI必须是“平台:/resource”,因为它不在类路径上,所以应该更改为: “平台:/resource/${projectName}/../Less.xtext” 当然,要修复解析错误,请将proje

在尝试mavenize时遇到了问题

在#208中添加了提交


我知道这是一个迟到的答复,但我遇到了同样的问题,花了一些时间找到问题的根源

错误消息实际上指向**.mwe2文件中的语法

eclipse创建的默认语法是: “类路径:/…/Less.xtext”

mavenized项目后,grammarURI必须是“平台:/resource”,因为它不在类路径上,所以应该更改为: “平台:/resource/${projectName}/../Less.xtext”

当然,要修复解析错误,请将projectName声明移到grammarURI的前面

因此**.mwe2中的声明最后应该如下所示:

/。。。
var projectName=“net.vtst.ow.eclipse.less”
var grammarURI=“平台:/resource/${projectName}/src/net/vtst/ow/eclipse/less/less.xtext”
// ...

    <!-- adapted from http://www.eclipse.org/forums/index.php/t/639454/ -->
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.5</version>
        <configuration>
            <filesets>
                <fileset>
                    <directory>${basedir}/src-gen</directory>
                </fileset>
                <fileset>
                    <directory>${basedir}/xtend-gen</directory>
                </fileset>
                <!-- clean ui plugin as well -->
                <fileset>
                    <directory>${basedir}/../${project.groupId}.${project.artifactId}.ui/src-gen</directory>
                </fileset>
                <fileset>
                    <directory>${basedir}/../${project.groupId}.${project.artifactId}.ui/xtend-gen</directory>
                </fileset>
                <!-- clean test fragment as well 
                <fileset>
                    <directory>${basedir}/../${project.groupId}.${project.artifactId}.tests/src-gen</directory>
                </fileset>
                <fileset>
                    <directory>${basedir}/../${project.groupId}.${project.artifactId}.tests/xtend-gen</directory>
                </fileset>
                -->
            </filesets>
        </configuration>
    </plugin>

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>java</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <includeProjectDependencies>false</includeProjectDependencies>
            <includePluginDependencies>true</includePluginDependencies>
            <mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
            <arguments>
                <argument>file://${project.basedir}/src/net/vtst/ow/eclipse/less/GenerateLess.mwe2</argument>
                <argument>
                    -p
                </argument>
                <argument>
                    runtimeProject=/${project.basedir}
                </argument>
            </arguments>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.xtext</artifactId>
                <version>2.5.4</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.xtext</groupId>
                <artifactId>org.eclipse.xtext.xbase</artifactId>
                <version>2.5.4</version>
            </dependency>
        </dependencies>
    </plugin>
    <plugin>
        <groupId>org.eclipse.xtend</groupId>
        <artifactId>xtend-maven-plugin</artifactId>
        <version>2.5.4</version>
    </plugin>
[INFO] --- exec-maven-plugin:1.2.1:java (default) @ net.vtst.ow.eclipse.less ---
0    [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri 'C:\Users\weibl\git\ow\src\eclipse'
745  [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems instantiating module net.vtst.ow.eclipse.less.GenerateLess: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module net.vtst.ow.eclipse.less.GenerateLess: java.lang.reflect.InvocationTargetException
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:95)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
    at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:143)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:62)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:93)
    ... 10 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
    ... 43 more
Caused by: org.eclipse.xtext.resource.ClasspathUriResolutionException: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/net/vtst/ow/eclipse/less/Less.xtext'
    at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:48)
    at org.eclipse.xtext.resource.XtextResourceSet.resolveClasspathURI(XtextResourceSet.java:160)
    at org.eclipse.xtext.resource.XtextResourceSet.access$0(XtextResourceSet.java:159)
    at org.eclipse.xtext.resource.XtextResourceSet$1.normalize(XtextResourceSet.java:216)
    at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:178)
    at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:205)
    ... 48 more
Caused by: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/net/vtst/ow/eclipse/less/Less.xtext'
    at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:60)
    at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:45)
    ... 53 more