nar maven插件>;=3.3.0失败,带“;msvc.version未指定“未指定”;
我想用Maven和Cygwin的gcc在Windows机器上构建一个helloworld C程序。nar maven插件版本3.2.3的构建是成功的,但如果使用更高版本,如3.4.0,构建总是失败 [错误]未能在项目helloworld:msvc.version上执行目标com.github.maven nar:nar maven插件:3.4.0:nar验证(默认nar验证)。未指定版本,也没有VSCOMNTOOLS环境 为什么呢?我不想使用Microsoft编译器 我的项目结构:nar maven插件>;=3.3.0失败,带“;msvc.version未指定“未指定”;,c,maven,gcc,cygwin,C,Maven,Gcc,Cygwin,我想用Maven和Cygwin的gcc在Windows机器上构建一个helloworld C程序。nar maven插件版本3.2.3的构建是成功的,但如果使用更高版本,如3.4.0,构建总是失败 [错误]未能在项目helloworld:msvc.version上执行目标com.github.maven nar:nar maven插件:3.4.0:nar验证(默认nar验证)。未指定版本,也没有VSCOMNTOOLS环境 为什么呢?我不想使用Microsoft编译器 我的项目结构: sr
src/main/c/helloworld.c
pom.xml
My pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.foo.bar</groupId>
<artifactId>helloworld</artifactId>
<packaging>nar</packaging>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.4.0</version>
<extensions>true</extensions>
<configuration>
<c>
<name>gcc</name>
<includes>
<include>**/*.c</include>
</includes>
</c>
<linker>
<name>gcc</name>
</linker>
<libraries>
<library>
<type>executable</type>
<run>false</run>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
4.0.0
com.foo.bar
地狱世界
纳尔
1.0-快照
com.github.maven-nar
nar maven插件
3.4.0
真的
海湾合作委员会
**/*c
海湾合作委员会
可执行
假的
我的生成输出:
C:\CC4\c_test>which gcc
C:\cygwin64\bin\gcc.EXE
C:\CC4\c_test>gcc --version
gcc (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\CC4\c_test>mvn clean install
### C:\Users\jokroebe\mavenrc_pre.bat
### Set JAVA_HOME for maven to C:\Program Files\Java\jdk1.7.0_80
### Set MAVEN_OPTS to -Xmx1024m -XX:MaxPermSize=512m
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
[INFO] Deleting C:\CC4\c_test\target
[INFO]
[INFO] --- nar-maven-plugin:3.4.0:nar-validate (default-nar-validate) @ helloworld ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.436 s
[INFO] Finished at: 2016-03-31T20:45:42+02:00
[INFO] Final Memory: 9M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.4.0:nar-validate (default-nar-validate) on project helloworld: msvc.version not specified and no VS<Version>COMNTOOLS environment
variable can be found -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/MojoExecutionException
C:\CC4\C\u test>哪个gcc
C:\cygwin64\bin\gcc.EXE
C:\CC4\C\U测试>gcc--版本
通用条款(gcc)5.3.0
版权所有(C)2015免费软件基金会。
这是自由软件;有关复制条件,请参见源。没有
担保甚至不是为了适销性或适合某一特定目的。
C:\CC4\C\U测试>mvn清洁安装
###C:\Users\jokroebe\mavenrc\u pre.bat
###将maven的JAVA\u HOME设置为C:\Program Files\JAVA\jdk1.7.0\u 80
###将MAVEN_OPTS设置为-Xmx1024m-XX:MaxPermSize=512m
[信息]正在扫描项目。。。
[信息]
[信息]------------------------------------------------------------------------
[信息]构建helloworld 1.0-SNAPSHOT
[信息]------------------------------------------------------------------------
[信息]
[信息]---maven clean插件:2.5:clean(默认清洁)@helloworld---
[信息]删除C:\CC4\C\U测试\目标
[信息]
[信息]---nar maven插件:3.4.0:nar验证(默认nar验证)@helloworld---
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:5.436秒
[信息]完成时间:2016-03-31T20:45:42+02:00
[信息]最终内存:9M/154M
[信息]------------------------------------------------------------------------
[错误]未能在项目helloworld:msvc.version上执行目标com.github.maven nar:nar maven插件:3.4.0:nar验证(默认nar验证)。未指定版本,也没有VSCOMNTOOLS环境
可以找到变量->[帮助1]
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
我也在谷歌集团“NAR Maven插件”网站上发布了这篇文章,该网站已开通223期,请参见。我也在谷歌集团“NAR Maven插件”网站上发布了这篇文章,该网站已开通223期,请参见。