当更新到3.3.0时,Maven NAR在Windows.h中插入了大量错误

时间:2016-03-09 22:09:01

标签: c++ maven maven-plugin

有这个简单的程序:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>lmiguelmh.test</groupId>
    <artifactId>msgbox-app</artifactId>
    <version>1.0</version>
    <packaging>nar</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>com.github.maven-nar</groupId>
                <artifactId>nar-maven-plugin</artifactId>
                <version>3.2.3</version>
                <extensions>true</extensions>
                <configuration>
                    <libraries>
                        <library>
                            <type>executable</type>
                            <run>true</run>
                        </library>
                    </libraries>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

这个简单的pom.xml:

nar-maven-plugin

在这种情况下,我使用的是mvn compile版本 3.2.3 。我可以运行msgbox-app.exe,并且将成功生成工件nar-maven-plugin

但是,当我将mvn compile的版本更改为 3.3.0 并运行[INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1243) : error C2065: 'SAL_sameIRQL' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1243) : error C2065: 'SAL_sameIRQL' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2513: 'int' : no variable declared before '=' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2513: 'int' : no variable declared before '=' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2146: syntax error : missing ';' before identifier 'EXCEPTION_DISPOSITION' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2146: syntax error : missing ';' before identifier 'EXCEPTION_DISPOSITION' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2143: syntax error : missing ';' before '__stdcall' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2143: syntax error : missing ';' before '__stdcall' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2377: 'EXCEPTION_DISPOSITION' : redefinition; typedef cannot be overloaded with any other symbol [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1246) : error C2377: 'EXCEPTION_DISPOSITION' : redefinition; typedef cannot be overloaded with any other symbol [INFO] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\excpt.h(44) : see declaration of 'EXCEPTION_DISPOSITION' [INFO] C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\excpt.h(44) : see declaration of 'EXCEPTION_DISPOSITION' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1252) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1252) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C2143: syntax error : missing ';' before '*' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C2143: syntax error : missing ';' before '*' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C2365: 'EXCEPTION_ROUTINE' : redefinition; previous definition was 'function' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C2365: 'EXCEPTION_ROUTINE' : redefinition; previous definition was 'function' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1247) : see declaration of 'EXCEPTION_ROUTINE' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1247) : see declaration of 'EXCEPTION_ROUTINE' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1254) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C2146: syntax error : missing ';' before identifier 'Handler' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C2146: syntax error : missing ';' before identifier 'Handler' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(10749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(16638) : error C2144: syntax error : 'PSLIST_ENTRY' should be preceded by ',' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(16638) : error C2144: syntax error : 'PSLIST_ENTRY' should be preceded by ',' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(16646) : error C2144: syntax error : 'PSLIST_ENTRY' should be preceded by ',' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(16646) : error C2144: syntax error : 'PSLIST_ENTRY' should be preceded by ',' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(124) : error C2061: syntax error : identifier '_SA_annotes1' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(124) : error C2061: syntax error : identifier '_SA_annotes1' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(125) : error C2059: syntax error : ')' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(125) : error C2059: syntax error : ')' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(125) : error C2143: syntax error : missing ')' before ';' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\heapapi.h(125) : error C2143: syntax error : missing ')' before ';' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\processthreadsapi.h(204) : error C2144: syntax error : 'LPVOID' should be preceded by ',' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\processthreadsapi.h(204) : error C2144: syntax error : 'LPVOID' should be preceded by ',' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(189) : error C2065: 'SAL_preferredFunction' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(189) : error C2065: 'SAL_preferredFunction' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(192) : error C2448: '_SA_annotes2' : function-style initializer appears to be a function definition [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(192) : error C2448: '_SA_annotes2' : function-style initializer appears to be a function definition [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(192) : error C2143: syntax error : missing ';' before '__stdcall' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(192) : error C2143: syntax error : missing ';' before '__stdcall' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2146: syntax error : missing ')' before identifier 'NameType' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2146: syntax error : missing ')' before identifier 'NameType' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2491: 'GetComputerNameExA' : definition of dllimport data not allowed [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(351) : error C2491: 'GetComputerNameExA' : definition of dllimport data not allowed [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(354) : error C2059: syntax error : ')' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(354) : error C2059: syntax error : ')' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2146: syntax error : missing ')' before identifier 'NameType' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2146: syntax error : missing ')' before identifier 'NameType' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2491: 'GetComputerNameExW' : definition of dllimport data not allowed [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(361) : error C2491: 'GetComputerNameExW' : definition of dllimport data not allowed [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(364) : error C2059: syntax error : ')' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(364) : error C2059: syntax error : ')' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2146: syntax error : missing ')' before identifier 'NameType' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2146: syntax error : missing ')' before identifier 'NameType' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2491: 'SetComputerNameExW' : definition of dllimport data not allowed [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(383) : error C2491: 'SetComputerNameExW' : definition of dllimport data not allowed [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(385) : error C2059: syntax error : ')' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\sysinfoapi.h(385) : error C2059: syntax error : ')' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(429) : error C2065: 'MEMORY_RESOURCE_NOTIFICATION_TYPE' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(429) : error C2065: 'MEMORY_RESOURCE_NOTIFICATION_TYPE' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2146: syntax error : missing ')' before identifier 'NotificationType' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2146: syntax error : missing ')' before identifier 'NotificationType' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2491: 'CreateMemoryResourceNotification' : definition of dllimport data not allowed [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2491: 'CreateMemoryResourceNotification' : definition of dllimport data not allowed [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2059: syntax error : ')' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(430) : error C2059: syntax error : ')' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(536) : error C2061: syntax error : identifier 'PWIN32_MEMORY_RANGE_ENTRY' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\memoryapi.h(536) : error C2061: syntax error : identifier 'PWIN32_MEMORY_RANGE_ENTRY' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\threadpoolapiset.h(341) : error C2061: syntax error : identifier 'PTP_WIN32_IO_CALLBACK' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\threadpoolapiset.h(341) : error C2061: syntax error : identifier 'PTP_WIN32_IO_CALLBACK' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(54) : error C2061: syntax error : identifier 'BEM_FREE_INTERFACE_CALLBACK' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(54) : error C2061: syntax error : identifier 'BEM_FREE_INTERFACE_CALLBACK' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(64) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(64) : error C2143: syntax error : missing ',' before '*' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(64) : error C2143: syntax error : missing ',' before '*' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(73) : error C2065: 'BEM_REFERENCE' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(73) : error C2065: 'BEM_REFERENCE' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(73) : error C2065: 'reference' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(73) : error C2065: 'reference' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(74) : error C2065: 'BEM_REFERENCE' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(74) : error C2065: 'BEM_REFERENCE' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : error C2065: 'copiedReference' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : error C2065: 'copiedReference' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : error C2078: too many initializers [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(75) : error C2078: too many initializers [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(81) : error C2065: 'BEM_REFERENCE' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(81) : error C2065: 'BEM_REFERENCE' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : error C2065: 'reference' : undeclared identifier [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : error C2065: 'reference' : undeclared identifier [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : warning C4229: anachronism used : modifiers on data are ignored [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : error C2182: 'BemFreeReference' : illegal use of type 'void' [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : error C2182: 'BemFreeReference' : illegal use of type 'void' [INFO] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : fatal error C1903: unable to recover from previous error(s); stopping compilation [ERROR] C:\Program Files (x86)\Windows Kits\8.0\Include\um\bemapiset.h(82) : fatal error C1903: unable to recover from previous error(s); stopping compilation 时,我收到了很多错误:

[DEBUG] cl  /c /nologo /EHsc /DNDEBUG /MD /GR /DWindows /DWIN32 /IE:\PROY\test\dev\1.0\msgbox-app\src\main\include E:\PROY\test\dev\1.0\msgbox-app\src\main\c\main.cpp
[DEBUG] Execute:Java13CommandLauncher: Executing 'cl' with arguments:
''
'/c'
'/nologo'
'/EHsc'
'/DNDEBUG'
'/MD'
'/GR'
'/DWindows'
'/DWIN32'
'/IE:\PROY\test\dev\1.0\msgbox-app\src\main\include'
'E:\PROY\test\dev\1.0\msgbox-app\src\main\c\main.cpp'

更新 也许问题是区别1)在搜索编译器的方式中搜索Visual Studio(在我的情况下,我有msvc9和msvc11)的方式:

适用于3.2.3

[DEBUG] "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\cl"  /c /nologo /EHsc /DNDEBUG /MD /GR /DWIN32 /IE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc /IE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc /IE:\PROY\test\dev\1.0\msgbox-app\src\main\include "/IC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include" "/IC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include" "/IC:\Program Files (x86)\Windows Kits\8.0\Include\um" "/IC:\Program Files (x86)\Windows Kits\8.0\Include\shared" "/IC:\Program Files (x86)\Windows Kits\8.0\Include\winrt" /FoE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc\main.c1e925e5.obj c/main.cpp
[DEBUG] Setting environment variable: PATH=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Windows Kits\8.0\bin\x86;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem
[DEBUG] Setting environment variable: SystemRoot=C:\windows
[DEBUG] Setting environment variable: TMP=C:\Users\lmamani\AppData\Local\Temp
[DEBUG] Execute:Java13CommandLauncher: Executing 'C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\cl' with arguments:
''
'/c'
'/nologo'
'/EHsc'
'/DNDEBUG'
'/MD'
'/GR'
'/DWIN32'
'/IE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc'
'/IE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc'
'/IE:\PROY\test\dev\1.0\msgbox-app\src\main\include'
'/IC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include'
'/IC:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include'
'/IC:\Program Files (x86)\Windows Kits\8.0\Include\um'
'/IC:\Program Files (x86)\Windows Kits\8.0\Include\shared'
'/IC:\Program Files (x86)\Windows Kits\8.0\Include\winrt'
'/FoE:\PROY\test\dev\1.0\msgbox-app\target\nar\obj\x86-Windows-msvc\main.c1e925e5.obj'
'c/main.cpp'

适用于3.3.0

nav_menu_css_class

重要提示:此问题的最新更新可在https://github.com/maven-nar/nar-maven-plugin/issues/217

中找到

1 个答案:

答案 0 :(得分:0)

正如我所说,问题是添加到Maven NAR插件的功能。最初的答案由GregDomjan在github上发布,可以在这里找到:

Maven NAR Plugin: Compiler errors in a simple program that uses Windows.h in version 3.3.0

TLDR:您需要使用最新版本的插件(3.3.0)并根据您的环境修改配置(在我的情况下为msvc11.0 / winsdk8.0):

<build>
    <plugins>
        <plugin>
            <groupId>com.github.maven-nar</groupId>
            <artifactId>nar-maven-plugin</artifactId>
            <version>3.3.0</version>
            <extensions>true</extensions>
            <configuration>
                <libraries>
                    <library>
                        <type>executable</type>
                        <run>true</run>
                    </library>
                </libraries>
                <msvc>
                    <version>11.0</version>
                    <windowsSdkVersion>8.0</windowsSdkVersion>
                </msvc>
            </configuration>
        </plugin>
    </plugins>
</build>