maven 打包 protobuf

4 篇文章 0 订阅
2 篇文章 0 订阅

maven 打包 protobuf[转]

 windows环境下载maven  ,把maven 的bin目录加入到环境变量. cmd 面板  mvn -versions 查看是否配置成功

1. 下载 protobuf最新版本:https://code.google.com/p/protobuf/downloads/detail?name=protobuf-2.5.0.tar.gz

2. 解压后发现没有包.java下面只有一个POM.xml. 用maven吧.(mvn3的环境自己上网找吧)

3. cmd进入protobuf-2.5.0\java\ 运行 mvn package

    发现错误:

Java代码  

  1. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.3:run (generate-test-sources) on project protobuf-java: An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "..\src\protoc": CreateProcess error=2, ????????? -> [Help 1]  

  2. [ERROR]  

  3. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.  

  4. [ERROR] Re-run Maven using the -X switch to enable full debug logging.  

  5. [ERROR] For more information about the errors and possible solutions, please read the following articles:  

  6. [ERROR] [Help 1]   

 看看到IOExcption,缺少文件呀,上网找找资料,原来是缺少protoc.exe

4. copy文件protoc.exe 到protobuf-2.5.0\src\ 再次执行 mvn package

5. protobuf-2.5.0\java\target\protobuf-java-2.5.0.jar


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值