Maven build fails to assemble jar because jar is read-only?
-
2012년 2월 8일 수요일 오후 11:50
I am using TFS 2010 and the Maven build extension. I have many working builds in place. I have a new one however that compiles source code but then fails when it tries to create a jar file. I have googled my fingers to the bone. Does anyone have a suggestion? BTW, I can run a Maven build manually on the build server on top of the source pulled over by TFS, and the manual build works fine. Also, the jar that is read-only is created by the Maven build. (And it is read-only when built with TFS and not read-only when built manually. I checked.)
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Services-Core
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 23 source files to C:\Builds\7\Services-Core\test4\Sources\web\WEB-INF\classes
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 10 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Not compiling test sources
[INFO] [surefire:test {execution: default-test}]
[INFO] Tests are skipped.
[INFO] [jar:jar {execution: default-jar}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error assembling JAREmbedded error: C:\Builds\7\Services-Core\test4\Sources\target\Services-Core-1.0.0.jar is read-only.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Feb 08 23:21:35 GMT 2012
[INFO] Final Memory: 18M/45M
[INFO] ------------------------------------------------------------------------
AJ_3
- 편집됨 AJ_3 2012년 2월 8일 수요일 오후 11:54
- 편집됨 AJ_3 2012년 2월 8일 수요일 오후 11:56
- 이동됨 Vicky Song 2012년 2월 10일 금요일 오전 2:41 (From:Team Foundation Server - Build Automation)
모든 응답
-
2012년 2월 9일 목요일 오후 6:34
OK, I have something to add...
My Team Project name had a hyphen in it. For want of anything better to do, I modified the POM and removed the hyphen (derived from the project name) from artifactId and name. Now my jar is writable and my build succeeds. Explanations are welcome...
AJ_3
- 편집됨 AJ_3 2012년 2월 9일 목요일 오후 6:40
-
2012년 2월 10일 금요일 오전 2:41
Hi AJ_3,
I am moving your case to the Team Foundation Server - Eclipse and Cross Platform forum so that you can get better support there.
Thanks.
Vicky Song [MSFT]
MSDN Community Support | Feedback to us
-
2012년 2월 13일 월요일 오전 11:37소유자
That is very odd. Can you try putting the hypen back in and seeing if it stops working again?
If you hadn't posted back about the hyphen thing then I would have assumed that the Maven targets directory was not being ignored and so the jar file that you are building has been accidentally checked in to TFS.
But the hyphen thing is confusing me - it doesn't reproduce when I do this locally (I get the same results with and without the hypen)
Apologies,
Martin.
http://www.woodwardweb.com
- 답변으로 제안됨 Martin WoodwardMicrosoft Employee, Owner 2012년 2월 15일 수요일 오후 8:16
-
2012년 2월 15일 수요일 오후 9:19I did that right after it started working. (I had trouble believing it myself.) And, after I put the hyphen in, it failed again. I took it out and it succeeded again.
AJ_3

