使用 flexmojos-maven-plugin 时如何获取信息丰富的编译错误消息?

发布于 2024-09-05 15:41:23 字数 273 浏览 9 评论 0原文

我正在使用 flexmojos-maven-plugin 构建我的 Flex 模块。所以在编译阶段我得到

org.apache.maven.plugin.MojoExecutionException:编译错误!

没有关于错误发生的位置(在哪个源文件中)以及编译错误的性质的信息。如果有人能指导我如何让 flexmojos-maven-plugin 打印有关编译错误的更多信息,我将不胜感激。

I'am using flexmojos-maven-plugin to build my Flex module. So on the compile phase I'm getting

org.apache.maven.plugin.MojoExecutionException: Error compiling!

with no information on where (at what source file) the error happens and what is nature of the compile error. I'll appreciate if anyone can instruct me on how to make flexmojos-maven-plugin print more information about compile errors.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

落墨 2024-09-12 15:41:23

我有类似的问题。第一个答案是,在编译时获取更多信息是使用内置的 maven -X 选项。

mvn -X clean install

这将为您提供描述此错误发生位置的输出。对我来说,我遇到了与您遇到的错误非常相似的错误,可以这么说,它最终来自“Adobe 的代码”。

就我而言,通过浏览错误堆栈跟踪:

[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.0-SNAPSHOT:sign-air
(default-sign-air) on project barebones-air: Error invoking AIR api: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.0-SNAPSHOT:sign-air
(default-sign-air) on project barebones-air: Error invoking AIR api

...[other stacktrace output, snipped]...

Caused by: java.lang.NullPointerException
    at com.adobe.air.ADTOutputStream.addApplicationDescriptor(ADTOutputStream.java:330)
    at com.adobe.air.AIROutputStream.addApplicationDescriptor(AIROutputStream.java:63)
    at com.adobe.air.ApplicationPackager.addSpecialFiles(ApplicationPackager.java:242)
    at com.adobe.air.AIRPackager.addSpecialFiles(AIRPackager.java:172)
    at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java:63)
    at org.sonatype.flexmojos.plugin.air.packager.FlexmojosAIRPackager.createPackage(FlexmojosAIRPackager.java:72)
    at org.sonatype.flexmojos.plugin.air.SignAirMojo.doPackage(SignAirMojo.java:332)
    ... 26 more

...[other stacktrace output, snipped]...

我可以看出它与描述符文件有关。因此,我打开我的描述符文件并(基于一些谷歌搜索)更改了以下内容:

<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>

到:

<content>MyAppName.swf</content>

和:

    <visible>false</visible>
</initialWindow>

到:

    <visible>true</visible>
</initialWindow>

第一个更改修复了空指针异常,第二个更改允许显示我的应用程序窗口。

我希望这对某人有帮助,
-gMale


edit:

另外,请务必在 Flexmojos 的配置中明确指向您的描述符:

<plugin>
    <groupId>org.sonatype.flexmojos</groupId>
    <artifactId>flexmojos-maven-plugin</artifactId>
    <version>${flexmojos.version}</version>
    <configuration>
        <sourceFile>${application.name}.mxml</sourceFile>
        <finalName>${application.name}</finalName>             
        <descriptorTemplate>${project.build.sourceDirectory}/${application.name}-app.xml</descriptorTemplate>
        <storepass>${keystore.password}</storepass>
    </configuration>
    <extensions>true</extensions>
    <dependencies>
        <dependency>
            <groupId>com.adobe.flex</groupId>
            <artifactId>compiler</artifactId>
            <version>${flex.sdk.version}</version>
            <type>pom</type>
        </dependency>
    </dependencies>
</plugin>

I had a similar problem. The first answer, to get more information when compiling is to use the built-in maven -X option.

mvn -X clean install

That will give you output that describes where this error is happening. For me, I had a very similar error to the one you have and it was ultimately coming from "Adobe's code," so to speak.

In my case, by skimming over the error stacktrace:

[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.0-SNAPSHOT:sign-air
(default-sign-air) on project barebones-air: Error invoking AIR api: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.0-SNAPSHOT:sign-air
(default-sign-air) on project barebones-air: Error invoking AIR api

...[other stacktrace output, snipped]...

Caused by: java.lang.NullPointerException
    at com.adobe.air.ADTOutputStream.addApplicationDescriptor(ADTOutputStream.java:330)
    at com.adobe.air.AIROutputStream.addApplicationDescriptor(AIROutputStream.java:63)
    at com.adobe.air.ApplicationPackager.addSpecialFiles(ApplicationPackager.java:242)
    at com.adobe.air.AIRPackager.addSpecialFiles(AIRPackager.java:172)
    at com.adobe.air.ApplicationPackager.createPackage(ApplicationPackager.java:63)
    at org.sonatype.flexmojos.plugin.air.packager.FlexmojosAIRPackager.createPackage(FlexmojosAIRPackager.java:72)
    at org.sonatype.flexmojos.plugin.air.SignAirMojo.doPackage(SignAirMojo.java:332)
    ... 26 more

...[other stacktrace output, snipped]...

I could tell it had something to do with the descriptor file. So I opened my descriptor file and (based on a few google searches) changed the following:

<content>[This value will be overwritten by Flash Builder in the output app.xml]</content>

to:

<content>MyAppName.swf</content>

and:

    <visible>false</visible>
</initialWindow>

to:

    <visible>true</visible>
</initialWindow>

The first change fixed the null pointer exception and the second allowed my application window to display.

I hope this helps someone,
-gMale


edit:

Also, be sure to explicitly point to your descriptor in the configuration of Flexmojos:

<plugin>
    <groupId>org.sonatype.flexmojos</groupId>
    <artifactId>flexmojos-maven-plugin</artifactId>
    <version>${flexmojos.version}</version>
    <configuration>
        <sourceFile>${application.name}.mxml</sourceFile>
        <finalName>${application.name}</finalName>             
        <descriptorTemplate>${project.build.sourceDirectory}/${application.name}-app.xml</descriptorTemplate>
        <storepass>${keystore.password}</storepass>
    </configuration>
    <extensions>true</extensions>
    <dependencies>
        <dependency>
            <groupId>com.adobe.flex</groupId>
            <artifactId>compiler</artifactId>
            <version>${flex.sdk.version}</version>
            <type>pom</type>
        </dependency>
    </dependencies>
</plugin>
人疚 2024-09-12 15:41:23

我以前也遇到过这样的情况。事实证明,实际的错误消息隐藏在控制台输出中的某个位置。

尝试将执行的 Maven 命令生成的所有控制台输出复制粘贴到文本编辑器中的某个位置,然后搜索字符串“ERROR”。

I have been in a situation like this before. It turns out that the actual error message is hidden somewhere in the console output.

Try to copy-paste all the console outputs generated from that executed maven command into a text editor somewhere and search the string 'ERROR'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文