NutzCN Logo
问答 build.py打包出现问题
发布于 28天前 作者 shuxinyun 131 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 
==================== RESTART: D:\git\Distributed\build.py ====================
Traceback (most recent call last):
  File "D:\git\Distributed\build.py", line 31, in <module>
    subprocess.check_call("java -jar starter.jar -inject ROOT.war -output nutzwk.jar", shell=True, cwd="dst/")
  File "C:\Users\shufu_000\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'java -jar starter.jar -inject ROOT.war -output nutzwk.jar' returned non-zero exit status 1.
>>> 
29 回复

有无生成Root.war

没有,文件夹下hi空的

你在哪里执行的???

Python 3.6.2 shell窗口下,用file+open+build.py
弹开新窗口,
在新窗口中
点击run-run module

命令行下,cd到项目所在的目录,然后 python build.py

Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> cd python build.py
  File "<stdin>", line 1
    cd python build.py
            ^
SyntaxError: invalid syntax
>>> cd d:
  File "<stdin>", line 1
    cd d:
       ^
SyntaxError: invalid syntax
>>> cd d:\git
  File "<stdin>", line 1
    cd d:\git
       ^
SyntaxError: invalid syntax
>>> o.getcwd()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'o' is not defined
>>> import os
>>> os.getcwd()
'C:\\Users\\shufu_000\\AppData\\Local\\Programs\\Python\\Python36'
>>> os.chdir('D:\git\Distributed')
>>> os.getcwd()
'D:\\git\\Distributed'
>>> python build.py
  File "<stdin>", line 1
    python build.py
               ^
SyntaxError: invalid syntax
>>> build.py
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'build' is not defined
>>> python build.py
  File "<stdin>", line 1
    python build.py
               ^
SyntaxError: invalid syntax
>>>

cmd命令行,黑色窗口

C:\WINDOWS\system32>cd D:\git\Distributed

C:\WINDOWS\system32>d:

D:\git\Distributed>python build.py
'python' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

D:\git\Distributed>python build.py
'python' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

D:\git\Distributed>

```

是否需要设置系统参数

Microsoft Windows [版本 10.0.14393]
(c) 2016 Microsoft Corporation。保留所有权利。

C:\WINDOWS\system32>cd D:\git\Distributed

C:\WINDOWS\system32>d:

D:\git\Distributed>build.py
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] wk-app
[INFO] wk-web
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wk-app 4.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wk-app ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ wk-app ---
[INFO] Installing D:\git\Distributed\wk-app\pom.xml to C:\Users\shufu_000\.m2\repository\cn\wizzer\app\wk-app\4.0.1-SNAPSHOT\wk-app-4.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wk-web 4.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wk-web ---
[INFO] Deleting D:\git\Distributed\wk-app\wk-web\target
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] wk-app ............................................. SUCCESS [  0.429 s]
[INFO] wk-web ............................................. FAILURE [  1.754 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.372 s
[INFO] Finished at: 2017-07-24T11:58:32+08:00
[INFO] Final Memory: 7M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project wk-web: Failed to clean project: Failed to delete D:\git\Distributed\wk-app\wk-web\target\classes\ehcache.xml -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :wk-web
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wk-framework 4.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wk-framework ---
[INFO] Deleting D:\git\Distributed\wk-framework\target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ wk-framework ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\git\Distributed\wk-framework\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ wk-framework ---
[INFO] Compiling 36 source files to D:\git\Distributed\wk-framework\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ wk-framework ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ wk-framework ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ wk-framework ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ wk-framework ---
[INFO] Building jar: D:\git\Distributed\wk-framework\target\wk-framework-4.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ wk-framework ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\git\Distributed\wk-framework\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ wk-framework ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ wk-framework ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ wk-framework ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ wk-framework ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ wk-framework ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ wk-framework ---
[INFO] Installing D:\git\Distributed\wk-framework\target\wk-framework-4.0.1-SNAPSHOT.jar to C:\Users\shufu_000\.m2\repository\cn\wizzer\wk-framework\4.0.1-SNAPSHOT\wk-framework-4.0.1-SNAPSHOT.jar
[INFO] Installing D:\git\Distributed\wk-framework\pom.xml to C:\Users\shufu_000\.m2\repository\cn\wizzer\wk-framework\4.0.1-SNAPSHOT\wk-framework-4.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.041 s
[INFO] Finished at: 2017-07-24T11:58:41+08:00
[INFO] Final Memory: 21M/74M
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wk-starter 4.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.nutz:nutz-web:jar:1.r.61-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.656 s
[INFO] Finished at: 2017-07-24T11:58:44+08:00
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project wk-starter: Could not resolve dependencies for project cn.wizzer:wk-starter:jar:4.0.1-SNAPSHOT: Could not find artifact org.nutz:nutz-web:jar:1.r.61-SNAPSHOT -> [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/DependencyResolutionException
Error: Unable to access jarfile starter.jar
Traceback (most recent call last):
  File "D:\git\Distributed\build.py", line 31, in <module>
    subprocess.check_call("java -jar starter.jar -inject ROOT.war -output nutzwk.jar", shell=True, cwd="dst/")
  File "C:\Users\shufu_000\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'java -jar starter.jar -inject ROOT.war -output nutzwk.jar' returned non-zero exit status 1.

D:\git\Distributed>

dst目录下是空的

The POM for org.nutz:nutz-web:jar:1.r.61-SNAPSHOT

你配了maven镜像库吧?? http://nutzam.com/core/basic/maven.html

其他build都成功,最后出现错误:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.923 s
[INFO] Finished at: 2017-07-24T13:09:09+08:00
[INFO] Final Memory: 19M/80M
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wk-starter 4.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://jfrog.nutz.cn/artifactory/snapshots/org/nutz/nutz-web/1.r.61-SNAPSHOT/maven-metadata.xml
Downloading: https://jfrog.nutz.cn/artifactory/jcenter/org/nutz/nutz-web/1.r.61-SNAPSHOT/maven-metadata.xml
Downloaded: https://jfrog.nutz.cn/artifactory/snapshots/org/nutz/nutz-web/1.r.61-SNAPSHOT/maven-metadata.xml (967 B at 1.1
 kB/s)
Downloading: https://jfrog.nutz.cn/artifactory/snapshots/org/nutz/nutz/1.r.61-SNAPSHOT/maven-metadata.xml
Downloading: https://jfrog.nutz.cn/artifactory/jcenter/org/nutz/nutz/1.r.61-SNAPSHOT/maven-metadata.xml
Downloaded: https://jfrog.nutz.cn/artifactory/snapshots/org/nutz/nutz/1.r.61-SNAPSHOT/maven-metadata.xml (967 B at 5.1 kB/
s)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ wk-starter ---
[INFO] Deleting D:\git\Distributed\wk-starter\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ wk-starter ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\git\Distributed\wk-starter\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ wk-starter ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ wk-starter ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ wk-starter ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ wk-starter ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ wk-starter ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: D:\git\Distributed\wk-starter\target\wk-starter-4.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-assembly-plugin:3.0.0:single (default-cli) @ wk-starter ---
[INFO] Building jar: D:\git\Distributed\wk-starter\target\wk-starter-4.0.1-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.775 s
[INFO] Finished at: 2017-07-24T13:09:20+08:00
[INFO] Final Memory: 27M/103M
[INFO] ------------------------------------------------------------------------
17-07-24 13:09:21.476 INFO [main] Select SystemLog as Nutz.Log implement
17-07-24 13:09:21.684 DEBUG [main] Using 95 castor for Castors
17-07-24 13:09:21.698 DEBUG [main] ["-inject", "ROOT.war", "-output", "nutzwk.jar"]
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:3236)
        at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
        at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
        at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
        at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:167)
        at com.sun.java.util.jar.pack.Package$File.writeTo(Package.java:844)
        at com.sun.java.util.jar.pack.PackageWriter.writeFiles(PackageWriter.java:820)
        at com.sun.java.util.jar.pack.PackageWriter.write(PackageWriter.java:76)
        at com.sun.java.util.jar.pack.PackerImpl$DoPack.flushPackage(PackerImpl.java:610)
        at com.sun.java.util.jar.pack.PackerImpl$DoPack.flushAll(PackerImpl.java:564)
        at com.sun.java.util.jar.pack.PackerImpl$DoPack.run(PackerImpl.java:500)
        at com.sun.java.util.jar.pack.PackerImpl.pack(PackerImpl.java:100)
        at com.sun.java.util.jar.pack.Driver.main(Driver.java:313)
Traceback (most recent call last):
  File "D:\git\Distributed\build.py", line 32, in <module>
    subprocess.check_call("pack200 -r -G nutzwk.jar", shell=True, cwd="dst/")
  File "C:\Users\shufu_000\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'pack200 -r -G nutzwk.jar' returned non-zero exit status 1.

D:\git\Distributed>

dst下有nutzwk.jar,root.war,starter.jar

8G内存还不够呀,我重启系统试试

重启出现同样错误,内存溢出了?

改一下最后的java命令,加大内存试试

请问java命令,内存怎么加大?

改成

java -Xmx2g -jar starter.jar -inject ROOT.war -output nutzwk.jar

这样也有问题

java -Xms2g -Xmx4g -jar starter.jar -inject ROOT.war -output nutzwk.jar

内存问题依旧

你是不是改过什么东西? 我重新clone了一份nutzwk最新的源码, 然后执行

python build.py

是无错误输出的

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.628 s
[INFO] Finished at: 2017-07-24T15:38:55+08:00
[INFO] Final Memory: 53M/328M
[INFO] ------------------------------------------------------------------------
17-07-24 15:38:55.716 INFO [main] Select SystemLog as Nutz.Log implement
17-07-24 15:38:55.798 DEBUG [main] Using 95 castor for Castors
17-07-24 15:38:55.804 DEBUG [main] ["-inject", "ROOT.war", "-output", "nutzwk.jar"]

C:\Users\wendal\workspace\git\github\NutzWK>

原版呀,没有修改呀,我换个机器试试

所有的pom.xml都与项目的一样,配置也会只修改了数据库名字!我下载项目后打包成功!就是我自己的不可以!

有这个提示:

[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ wk-web ---
[INFO] Compiling 365 source files to D:\git\Distributed\wk-app\wk-web\target\classes
[INFO] /D:/git/Distributed/wk-app/wk-web/src/main/java/cn/wizzer/app/doc/modules/services/impl/DocReceiveHandleServiceImpl.java: 某些输入文件使用了未
经检查或不安全的操作。
[INFO] /D:/git/Distributed/wk-app/wk-web/src/main/java/cn/wizzer/app/doc/modules/services/impl/DocReceiveHandleServiceImpl.java: 有关详细信息, 请使用
-Xlint:unchecked 重新编译。
添加回复
请先登陆
回到顶部