HIT-SCIR / ltp4j

ltp4j: Language Technology Platform For Java
162 stars 82 forks source link

maven版本的ltp4j编译失败 #23

Open zxy00 opened 7 years ago

zxy00 commented 7 years ago

[INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for edu.hit.ir.ltp4j:ltp4j:nar:0.1.0-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 54, column 15 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building hitscir-ltp4j 0.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) @ ltp4j --- [INFO] Using AOL: x86_64-MacOSX-gpp [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-download (default-nar-download) @ ltp4j --- [INFO] Getting Nar dependencies [INFO] Getting Nar dependencies [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-unpack (default-nar-unpack) @ ltp4j --- [INFO] Getting Nar dependencies [INFO] Unpacking 0 dependencies to /Users/zxy/study/ltp/ltp4j/target/nar [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-gnu-configure (default-nar-gnu-configure) @ ltp4j --- [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-system-generate (default-nar-system-generate) @ ltp4j --- [INFO] Generating /Users/zxy/study/ltp/ltp4j/target/nar/nar-generated/edu/hit/ir/ltp4j/NarSystem.java [INFO] Not using 'native-lib-loader' because it is not a dependency) [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-vcproj (default-nar-vcproj) @ ltp4j --- [INFO] [INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ ltp4j --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/zxy/study/ltp/ltp4j/src/main/resources [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-resources (default-nar-resources) @ ltp4j --- [INFO] Copied 0 resources [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-gnu-resources (default-nar-gnu-resources) @ ltp4j --- [INFO] [INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ ltp4j --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 8 source files to /Users/zxy/study/ltp/ltp4j/target/classes [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-javah (default-nar-javah) @ ltp4j --- [INFO] Running /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javah compiler on 7 classes... [INFO] + /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javah -classpath /Users/zxy/study/ltp/ltp4j/target/classes -d /Users/zxy/study/ltp/ltp4j/target/nar/javah-include edu.hit.ir.ltp4j.NarSystem edu.hit.ir.ltp4j.SplitSentence edu.hit.ir.ltp4j.Postagger edu.hit.ir.ltp4j.Parser edu.hit.ir.ltp4j.Segmentor edu.hit.ir.ltp4j.NER edu.hit.ir.ltp4j.SRL [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-gnu-make (default-nar-gnu-make) @ ltp4j --- [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) @ ltp4j --- [INFO] Compiling 6 native files [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.560 s [INFO] Finished at: 2017-01-12T20:08:50+08:00 [INFO] Final Memory: 19M/207M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) on project ltp4j: NAR: Include path not found: com.github.maven_nar.IncludePath@37b57b54 -> [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/MojoFailureException zxydeMacBook-Pro:ltp4j zxy$ find target/ -type f -name ".jar" -or -name ".so" zxydeMacBook-Pro:ltp4j zxy$ find target/ -type f -name ".jar" -or -name ".so" zxydeMacBook

Oneplus commented 7 years ago

看起来好像是没拉ltp,试试先

git submodule init
git submodule update

mvn

zxy00 commented 7 years ago

我就是根据文档编译的,但是mac下,下载的ltp4j-neoltp4j不包含.gitmodules和.travrs.yml,在进到项目中编译的时候,git submodule init 不能用,然后网上查下,先git init,在执行git submodule init git submodule update就可以了,但是最后编译还是没成功

zxy00 commented 7 years ago

@Oneplus

zxy00 commented 7 years ago

@Oneplus

zxydeMacBook-Pro:ltp zxy$ cd ltp4j zxydeMacBook-Pro:ltp4j zxy$ git submodule init fatal: Not a git repository (or any of the parent directories): .git zxydeMacBook-Pro:ltp4j zxy$ git init Initialized empty Git repository in /Users/zxy/study/ltp/ltp4j/.git/ zxydeMacBook-Pro:ltp4j zxy$ git submodule init zxydeMacBook-Pro:ltp4j zxy$ git submodule update zxydeMacBook-Pro:ltp4j zxy$ mvn [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for edu.hit.ir.ltp4j:ltp4j:nar:0.1.0-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 54, column 15 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building hitscir-ltp4j 0.1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) @ ltp4j --- [INFO] Using AOL: x86_64-MacOSX-gpp [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-download (default-nar-download) @ ltp4j --- [INFO] Getting Nar dependencies [INFO] Getting Nar dependencies [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-unpack (default-nar-unpack) @ ltp4j --- [INFO] Getting Nar dependencies [INFO] Unpacking 0 dependencies to /Users/zxy/study/ltp/ltp4j/target/nar [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-gnu-configure (default-nar-gnu-configure) @ ltp4j --- [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-system-generate (default-nar-system-generate) @ ltp4j --- [INFO] Generating /Users/zxy/study/ltp/ltp4j/target/nar/nar-generated/edu/hit/ir/ltp4j/NarSystem.java [INFO] Not using 'native-lib-loader' because it is not a dependency) [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-vcproj (default-nar-vcproj) @ ltp4j --- [INFO] [INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ ltp4j --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/zxy/study/ltp/ltp4j/src/main/resources [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-resources (default-nar-resources) @ ltp4j --- [INFO] Copied 0 resources [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-gnu-resources (default-nar-gnu-resources) @ ltp4j --- [INFO] [INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ ltp4j --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 8 source files to /Users/zxy/study/ltp/ltp4j/target/classes [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-javah (default-nar-javah) @ ltp4j --- [INFO] Running /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javah compiler on 7 classes... [INFO] + /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javah -classpath /Users/zxy/study/ltp/ltp4j/target/classes -d /Users/zxy/study/ltp/ltp4j/target/nar/javah-include edu.hit.ir.ltp4j.NarSystem edu.hit.ir.ltp4j.SplitSentence edu.hit.ir.ltp4j.Postagger edu.hit.ir.ltp4j.Parser edu.hit.ir.ltp4j.Segmentor edu.hit.ir.ltp4j.NER edu.hit.ir.ltp4j.SRL [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-gnu-make (default-nar-gnu-make) @ ltp4j --- [INFO] [INFO] --- nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) @ ltp4j --- [INFO] Compiling 6 native files [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.150 s [INFO] Finished at: 2017-01-13T09:28:30+08:00 [INFO] Final Memory: 19M/204M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) on project ltp4j: NAR: Include path not found: com.github.maven_nar.IncludePath@4492eede -> [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/MojoFailureException zxydeMacBook-Pro:ltp4j zxy$

Oneplus commented 7 years ago

好像不是git clone的,所以实际ltp还是没拉下来。

建议

git clone https://github.com/HIT-SCIR/ltp4j.git
git checkout neoltp4j
git submodule init
git submodule update

关于是否把ltp拉下来了,只要看src/main/c++/ltp文件夹里面有没文件就知道了。 另外,如果看到Compiling 6 native files这个肯定是不对的,正常需要compile 150+个文件。

Oneplus commented 7 years ago

@endyul neoltp4j是不是mac下不能编译?我记得之前好像说过这件事。

endyul commented 7 years ago

能过编译的阶段,测试阶段过不去。编译的产出是可以用的

zxy00 commented 7 years ago

@Oneplus 尝试了你给的命令,不可以,第二个命令就错误了

endyul commented 7 years ago

@zxy00 请问报什么错?

Oneplus commented 7 years ago

中间差一个cd ltp4j On Thu, 12 Jan 2017 at 6:20 PM Oliver Xu notifications@github.com wrote:

@zxy00 https://github.com/zxy00 请问报什么错?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/HIT-SCIR/ltp4j/issues/23#issuecomment-272343625, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtgG5TJ44HMARwWvM1gu8vO7DLENuJWks5rRt9OgaJpZM4Lhr6D .

zxy00 commented 7 years ago

[WARNING] ltp/src/parser.n/parser.cpp:190:17: warning: implicit conversion changes signedness: 'const int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion] [ERROR] PUSH( CLUSTER(S1) ); [ERROR] ~~^ [ERROR] ltp/src/parser.n/parser.cpp:185:50: note: expanded from macro 'CLUSTER' [ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster) [ERROR] ~~~ ~~~~^~ [ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH' [ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0); [ERROR] ^~~~ [WARNING] ltp/src/parser.n/parser.cpp:191:9: warning: implicit conversion changes signedness: 'const value_type' (aka 'const int') to 'unsigned long' [-Wsign-conversion] [ERROR] PUSH( CLUSTER(S2) ); [ERROR] ~~^~~~~ [ERROR] ltp/src/parser.n/parser.cpp:185:38: note: expanded from macro 'CLUSTER' [ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster) [ERROR] ^ ~ [ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH' [ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0); [ERROR] ^~~~ [WARNING] ltp/src/parser.n/parser.cpp:191:17: warning: implicit conversion changes signedness: 'const int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion] [ERROR] PUSH( CLUSTER(S2) ); [ERROR] ~~^ [ERROR] ltp/src/parser.n/parser.cpp:185:50: note: expanded from macro 'CLUSTER' [ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster) [ERROR] ~~~ ~~~~^~ [ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH' [ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0); [ERROR] ^~~~ [WARNING] ltp/src/parser.n/parser.cpp:192:9: warning: implicit conversion changes signedness: 'const value_type' (aka 'const int') to 'unsigned long' [-Wsign-conversion] [ERROR] PUSH( CLUSTER(N0) ); PUSH( CLUSTER4(N0) ); PUSH( CLUSTER6(N0) ); [ERROR] ~~^~~~~ [ERROR] ltp/src/parser.n/parser.cpp:185:38: note: expanded from macro 'CLUSTER' [ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster) [ERROR] ^ ~ [ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH' [ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0); [ERROR] ^~~~ [WARNING] ltp/src/parser.n/parser.cpp:192:17: warning: implicit conversion changes signedness: 'const int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion] [ERROR] PUSH( CLUSTER(N0) ); PUSH( CLUSTER4(N0) ); PUSH( CLUSTER6(N0) ); [ERROR] ~~^ [ERROR] ltp/src/parser.n/parser.cpp:185:50: note: expanded from macro 'CLUSTER' [ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster) [ERROR] ~~~ ~~~~^~ [ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH' [ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0); [ERROR] ^~~~ [WARNING] ltp/src/parser.n/parser.cpp:192:33: warning: implicit conversion changes signedness: 'const value_type' (aka 'const int') to 'unsigned long' [-Wsign-conversion] [ERROR] PUSH( CLUSTER(N0) ); PUSH( CLUSTER4(N0) ); PUSH( CLUSTER6(N0) ); [ERROR] ~~^~~~~~ [ERROR] ltp/src/parser.n/parser.cpp:186:38: note: expanded from macro 'CLUSTER4' [ERROR] #define CLUSTER4(id) (ctx.id >= 0 ? (cluster4[ctx.id]+kCluster4InFeaturespace): kNilCluster4) [ERROR] ^ ~ [ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH' [ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0); [ERROR] ^~~~ [WARNING] ltp/src/parser.n/parser.cpp:192:42: warning: implicit conversion changes signedness: 'const int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion] [ERROR] PUSH( CLUSTER(N0) ); PUSH( CLUSTER4(N0) ); PUSH( CLUSTER6(N0) ); [ERROR] ~~~^ [ERROR] ltp/src/parser.n/parser.cpp:186:51: note: expanded from macro 'CLUSTER4' [ERROR] #define CLUSTER4(id) (ctx.id >= 0 ? (cluster4[ctx.id]+kCluster4InFeaturespace): kNilCluster4) [ERROR] ~~ ~~^~ ...... T E S T S

Running edu.hit.ir.ltp4j.test.SRLTest Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.13 sec <<< FAILURE! Running edu.hit.ir.ltp4j.test.NERTest Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.096 sec <<< FAILURE! Running edu.hit.ir.ltp4j.test.ParserTest Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.085 sec <<< FAILURE! Running edu.hit.ir.ltp4j.test.SegmentorTest Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.075 sec <<< FAILURE! Running edu.hit.ir.ltp4j.test.PostaggerTest Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.076 sec <<< FAILURE!

Results :

Tests in error: testPostaggerCreate(edu.hit.ir.ltp4j.test.PostaggerTest) testPostaggerPostag(edu.hit.ir.ltp4j.test.PostaggerTest)

Tests run: 9, Failures: 0, Errors: 9, Skipped: 0

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:11 min [INFO] Finished at: 2017-01-13T10:31:11+08:00 [INFO] Final Memory: 26M/325M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-integration-test (default-nar-integration-test) on project ltp4j: There are test failures. [ERROR] [ERROR] Please refer to /Users/zxy/ltp4j/target/surefire-reports for the individual test results. [ERROR] -> [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/MojoFailureException zxydeMacBook-Pro:ltp4j zxy$ Display all 1671 possibilities? (y or n) zxydeMacBook-Pro:ltp4j zxy$ Display all 1671 possibilities? (y or n) ! heap ptardiff5.18 ./ heap32 ptargrep .anaconda-navigator-post-link.sh help ptargrep5.16 .anaconda-navigator-pre-unlink.sh

@Oneplus @endyul

zxy00 commented 7 years ago

@Oneplus用你的方法,出现上面的错误

endyul commented 7 years ago

@zxy00 这里build已经完成了,test失败是maven-nar的bug,等待官方修复,可以暂时忽略 编译出的jar和动态库分别是: target/ltp4j-0.1.0-SNAPSHOT-x86_64-MacOSX-gpp-jni.nar target/nar/ltp4j-0.1.0-SNAPSHOT-x86_64-MacOSX-gpp-jni/lib/x86_64-MacOSX-gpp/jni/libltp4j-0.1.0-SNAPSHOT.jnilib

zxy00 commented 7 years ago

@endyul 这样就可以调用了吗,教程的话,生成ltp.jar,但是这个没有

zxy00 commented 7 years ago

@endyul @Oneplus 已经生成了,谢谢啦

endyul commented 7 years ago

@zxy00 这里生成的target/ltp4j-0.1.0-SNAPSHOT-x86_64-MacOSX-gpp-jni.nar就是

endyul commented 7 years ago

@zxy00 示例请参考这个文档 http://ltp4j.readthedocs.io/en/neoltp4j/api.html

zxy00 commented 7 years ago

@endyul 好的,谢谢

endyul commented 7 years ago

@Oneplus 我来跟进一下编译问题,完善一下文档. 然后正式release这个分支吧

Oneplus commented 7 years ago

@endyul 看看有没有可能提交到maven centeral,这样可以直接把ltp4j当成mvn dependency用。

endyul commented 7 years ago

@Oneplus 好的

zxy00 commented 7 years ago

#

A fatal error has been detected by the Java Runtime Environment:

#

SIGSEGV (0xb) at pc=0x00000001279b9cfa, pid=899, tid=0x0000000000001703

#

JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode bsd-amd64 compressed oops)

Problematic frame:

C [libltp4j-0.1.0-SNAPSHOT.jnilib+0x148cfa] ltp::framework::ViterbiDecoder::get_result(unsigned long const&, std::1::vector<int, std::1::allocator >&)+0x8a

#

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

#

An error report file with more information is saved as:

/Users/zxy/study/Java/workspace2/AnalysisByCognitive/hs_err_pid899.log

#

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug

@Oneplus @endyul 运行一段时间,出现上面的错误,怎么解决

liangyangtao commented 6 years ago

Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) on project ltp4j: Could not launch cmd.exe /X /C "link /?": Error while executing process. Cannot run program "link": CreateProcess error=2 tim 20171229162337

liangyangtao commented 6 years ago

[DEBUG] -- Searching for usable VisualStudio [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.829 s [INFO] Finished at: 2017-12-29T16:29:59+08:00 [INFO] Final Memory: 11M/150M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) on project ltp4j: Could not launch cmd.exe /X /C "lin org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) on pr at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) 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.MojoExecutionException: Could not launch cmd.exe /X /C "link /?" at com.github.maven_nar.NarUtil.runCommand (NarUtil.java:594) at com.github.maven_nar.Msvc.initVisualStudio (Msvc.java:317) at com.github.maven_nar.Msvc.init (Msvc.java:196) at com.github.maven_nar.Msvc.setMojo (Msvc.java:486) at com.github.maven_nar.AbstractNarMojo.validate (AbstractNarMojo.java:323) at com.github.maven_nar.AbstractNarMojo.execute (AbstractNarMojo.java:194) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) 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.codehaus.plexus.util.cli.CommandLineException: Error while executing process. at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:675) at com.github.maven_nar.NarUtil.runCommand (NarUtil.java:566) at com.github.maven_nar.Msvc.initVisualStudio (Msvc.java:317) at com.github.maven_nar.Msvc.init (Msvc.java:196) at com.github.maven_nar.Msvc.setMojo (Msvc.java:486) at com.github.maven_nar.AbstractNarMojo.validate (AbstractNarMojo.java:323) at com.github.maven_nar.AbstractNarMojo.execute (AbstractNarMojo.java:194) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) 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: java.io.IOException: Cannot run program "link": CreateProcess error=2, ??????????? at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048) at java.lang.Runtime.exec (Runtime.java:620) at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:655) at com.github.maven_nar.NarUtil.runCommand (NarUtil.java:566) at com.github.maven_nar.Msvc.initVisualStudio (Msvc.java:317) at com.github.maven_nar.Msvc.init (Msvc.java:196) at com.github.maven_nar.Msvc.setMojo (Msvc.java:486) at com.github.maven_nar.AbstractNarMojo.validate (AbstractNarMojo.java:323) at com.github.maven_nar.AbstractNarMojo.execute (AbstractNarMojo.java:194) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) 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: java.io.IOException: CreateProcess error=2, ??????????? at java.lang.ProcessImpl.create (Native Method) at java.lang.ProcessImpl. (ProcessImpl.java:386) at java.lang.ProcessImpl.start (ProcessImpl.java:137) at java.lang.ProcessBuilder.start (ProcessBuilder.java:1029) at java.lang.Runtime.exec (Runtime.java:620) at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:655) at com.github.maven_nar.NarUtil.runCommand (NarUtil.java:566) at com.github.maven_nar.Msvc.initVisualStudio (Msvc.java:317) at com.github.maven_nar.Msvc.init (Msvc.java:196) at com.github.maven_nar.Msvc.setMojo (Msvc.java:486) at com.github.maven_nar.AbstractNarMojo.validate (AbstractNarMojo.java:323) at com.github.maven_nar.AbstractNarMojo.execute (AbstractNarMojo.java:194) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) 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) [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/MojoExecutionException

liu946 commented 6 years ago

是否安装了VS呢? @liangyangtao

liangyangtao commented 6 years ago

@liu946 谢谢指点,是没有安装VS , 对c++了解不多,我安装试试

whitezdm commented 6 years ago

一直报Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) on project ltp4j: NAR: Include path not found: com.github.maven_nar.IncludePath,错误不知道错在哪里,vs2015也都安装了,很头疼

wuao-codebase commented 6 years ago

[ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) on project ltp4j: Could not launch cmd.exe /X /C "link /?": Error while executing process. Cannot run program "link": CreateProcess error=2, 系统找不到指定的文件。 -> [Help 1]

和@liangyangtao 一样的问题,安装vs2017后没能解决。

liu946 commented 6 years ago

可以参考一下 #35 。不知是否是因为test导致的。

yuye2133 commented 6 years ago

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:13 min [INFO] Finished at: 2018-02-10T20:40:34+08:00 [INFO] Final Memory: 11M/117M [INFO] ------------------------------------------------------------------------ [ERROR] Unknown lifecycle phase "Dmaven.test.skip=true". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException

xsy0rival commented 6 years ago

请问在Windows下怎么将ltp4j编译成jar包啊?