尝试在OSX中编译maven插件时JVM崩溃

时间:2016-06-14 05:22:41

标签: java macos maven maven-plugin

我正在尝试创建一个基本的mojo(只是你好世界)。但是,当我尝试编译maven插件时,JVM崩溃如下:

[INFO] --- maven-plugin-plugin:3.3:descriptor (default-descriptor) @ xyz-compiler-plugin ---
[INFO] Using 'UTF-8' encoding to read mojo metadata.
[INFO] Applying mojo extractor for language: java
[INFO] Mojo extractor for language: java found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: bsh
[INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: java-annotations
[INFO] Mojo extractor for language: java-annotations found 1 mojo descriptors.
2016-06-13 22:14:58.813 java[36254:2194441] Apple AWT Internal Exception: Critical error: required built-in appearance SystemAppearance not found
2016-06-13 22:14:58.814 java[36254:2194441] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Critical error: required built-in appearance SystemAppearance not found'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff9997a4f2 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff8f27bf7e objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff999e14bd +[NSException raise:format:] + 205
    3   libdispatch.dylib                   0x00007fff8f7a640b _dispatch_client_callout + 8
    4   libdispatch.dylib                   0x00007fff8f7a6303 dispatch_once_f + 67
    5   AppKit                              0x00007fff981c12ad +[NSAppearance _defaultAppearance] + 22
    6   AppKit                              0x00007fff981c113b +[NSAppearance appearanceNamed:] + 24
    7   AppKit                              0x00007fff981c09ee +[NSWindow initialize] + 166
    8   libobjc.A.dylib                     0x00007fff8f2723c8 _class_initialize + 711
    9   libobjc.A.dylib                     0x00007fff8f271d08 lookUpImpOrForward + 179
    10  libobjc.A.dylib                     0x00007fff8f26c591 objc_msgSend + 209
    11  AppKit                              0x00007fff981c05ed +[NSApplication initialize] + 719
    12  libobjc.A.dylib                     0x00007fff8f2723c8 _class_initialize + 711
    13  libobjc.A.dylib                     0x00007fff8f272156 _class_initialize + 85
    14  libobjc.A.dylib                     0x00007fff8f271d08 lookUpImpOrForward + 179
    15  libobjc.A.dylib                     0x00007fff8f26c591 objc_msgSend + 209
    16  libawt_lwawt.dylib                  0x0000000125cef2dc -[AWTStarter starter:] + 266
    17  Foundation                          0x00007fff8a0b3f5e __NSThreadPerformPerform + 279
    18  CoreFoundation                      0x00007fff9990f881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    19  CoreFoundation                      0x00007fff998eefbc __CFRunLoopDoSources0 + 556
    20  CoreFoundation                      0x00007fff998ee4df __CFRunLoopRun + 927
    21  CoreFoundation                      0x00007fff998eded8 CFRunLoopRunSpecific + 296
    22  java                                0x0000000103edc463 CreateExecutionEnvironment + 871
    23  java                                0x0000000103ed81ac JLI_Launch + 1952
    24  java                                0x0000000103ede4c0 main + 101
    25  java                                0x0000000103ed7a04 start + 52
    26  ???                                 0x000000000000000c 0x0 + 12
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

该项目有一个父POM项目。我尝试从IntelliJ和终端进行编译,但问题仍然存在。

我的课很简单

@Mojo(name="test")
public class BasicMojo extends AbstractMojo
{
    public void execute() throws MojoExecutionException
    {
        getLog().info( "Hello, this is a test." );
    }
}

我的POM依赖项如下所示:

<dependencies>
    <dependency>
        <groupId>com.xyz.network.tools</groupId>
        <artifactId>xyz-compiler</artifactId>
        <version>${micro.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>3.1.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>3.4</version>
    </dependency>
</dependencies>

任何线索?

2 个答案:

答案 0 :(得分:1)

其实我发现了这个问题。我设置了一个名为NEXT_ROOT的环境变量,这会导致问题。如果我在执行我的java程序之前取消它,我不会得到这个异常。谢谢大家的帮助。

答案 1 :(得分:0)

您可能内存不足,这会强制系统向实例化的视图控制器发送低内存消息。 -didReceiveMemoryWarning的默认实现清除视图成员变量。理论上,那么下次需要视图时,应该重新实例化,但是你可能已经覆盖了阻止它的东西。