Maven - >模块名称无法确定

时间:2016-01-25 10:03:19

标签: eclipse maven sap maven-plugin sapui5

我需要使用maven构建sapui5项目。 SAP提供了自己的构建插件,并且所有插件似乎都在这里,但maven-plugin-coldwater在构建时失败。

所以这是构建日志的一部分。我无法谷歌对这个错误有用的东西。

[ERROR] Failed to execute goal com.sap.ui5.tools.build:maven-coldwater-plugin:1.28.5:merge-modules (merge-application-modules) on project cprail.create.quote: Execution merge-application-modules of goal com.sap.ui5.tools.build:maven-coldwater-plugin:1.28.5:merge-modules failed: module name could not be determined -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.sap.ui5.tools.build:maven-coldwater-plugin:1.28.5:merge-modules (merge-application-modules) on project cprail.create.quote: Execution merge-application-modules of goal com.sap.ui5.tools.build:maven-coldwater-plugin:1.28.5:merge-modules failed: module name could not be determined
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution merge-application-modules of goal com.sap.ui5.tools.build:maven-coldwater-plugin:1.28.5:merge-modules failed: module name could not be determined
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
Caused by: java.lang.IllegalArgumentException: module name could not be determined
    at com.sap.ui5.tools.build.utils.jsparser.JSModuleAnalyzer.onDefine(JSModuleAnalyzer.java:261)
    at com.sap.ui5.tools.build.utils.jsparser.JSModuleAnalyzer.visit(JSModuleAnalyzer.java:130)
    at com.sap.ui5.tools.build.utils.jsparser.JSModuleAnalyzer.analyze(JSModuleAnalyzer.java:73)
    at com.sap.ui5.tools.build.utils.jsparser.JSModuleAnalyzer.analyze(JSModuleAnalyzer.java:64)
    at com.sap.ui5.tools.build.utils.jsparser.JSModuleAnalyzer.getInfo(JSModuleAnalyzer.java:33)
    at com.sap.ui5.tools.build.utils.modules.FileSystemResourceScanner.findPrefix(FileSystemResourceScanner.java:125)
    at com.sap.ui5.tools.maven.merge.MergedModuleMojo.doExecute(MergedModuleMojo.java:296)
    at com.sap.ui5.tools.maven.collage.MergedModuleMojo.doExecute(MergedModuleMojo.java:61)
    at com.sap.ui5.tools.maven.base.AbstractUI5Mojo.execute(AbstractUI5Mojo.java:129)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
    ... 20 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

1 个答案:

答案 0 :(得分:0)

我在产品版本中遇到了同样的问题。禁用autoDetectPrefix(删除<autoDetectPrefix>true</autoDetectPrefix>)后,它可以正常工作。

<plugin>
    <groupId>com.sap.ui5.tools.build</groupId>
    <artifactId>maven-coldwater-plugin</artifactId>
    <version>${sapui5.version}</version>
    <executions>
        <execution>
            <id>merge-application-modules</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>merge-modules</goal>
            </goals>
            <configuration>
                <themes>base,sap_hcb,sap_bluecrystal,sap_belize,sap_belize_plus,sap_belize_hcb,sap_belize_hcw</themes>
                <directions>ltr,rtl</directions>
                <locales>*</locales>
                <resourceRoots>
                    <resourceRoot>
                        <folder>${basedir}/src/*******</folder>
                        <filters>
                            <filter>!**/test/**</filter>
                        </filters>
                        <autoDetectPrefix>true</autoDetectPrefix>
                    </resourceRoot>
                </resourceRoots>
                <outputFolder>${merged.stuff}</outputFolder>
                <autoDetectOutputPrefix>true</autoDetectOutputPrefix>
                <defaultPreloadFile>XXXXX.js</defaultPreloadFile>
                <verbose>true</verbose>
            </configuration>
        </execution>
        <execution>
            <id>optimize-war</id>
            <phase>package</phase>
            <goals>
                <goal>optimize</goal>
            </goals>
            <configuration>
                <optimizeDefaultArtifact>false</optimizeDefaultArtifact>
            </configuration>
        </execution>
    </executions>
    <configuration>
        <scanNonStandardFolders>true</scanNonStandardFolders>
    </configuration>
</plugin>