during build phase teamcity throws error but it's building through maven without problem, why?

I set default maven to 3.1 on teamcity 8.1

I can build the project via console without problem?

        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <execution>
                        <id>copy-installed</id>
                        <phase>install</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <version>${project.version}</version>
                                    <type>${project.packaging}</type>
                                    <outputDirectory>${trunk_output}</outputDirectory>
                                    <destFileName>${build.finalName}.apk</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>



[com.triodor.today:today] Failed  to execute goal  org.apache.maven.plugins:maven-dependency-plugin:2.8:copy  (copy-installed) on project today: Error copying artifact from  C:\TeamCity\buildAgent\work\fbce55a8dab1cf33\Android\DailyWork\trunk\target\today_2.1.0.14_(trunk).apk  to Z:\today_2.1.0.14_(trunk).apk

[16:51:23][Step 1/1] [INFO] ------------------------------------------------------------------------
[16:51:23][Step 1/1] [INFO] Reactor Summary:
[16:51:23][Step 1/1] [INFO]
[16:51:23][Step 1/1] [INFO] zxing library ..................................... SUCCESS [58.953s]
[16:51:23][Step 1/1] [INFO] SlidingMenu ....................................... SUCCESS [11.269s]
[16:51:23][Step 1/1] [INFO] TriodorCommon ..................................... SUCCESS [34.440s]
[16:51:23][Step 1/1] [INFO] T4CLibrary ........................................ SUCCESS [1:39.218s]
[16:51:23][Step 1/1] [INFO] today ............................................. FAILURE [3:53.298s]
[16:51:23][Step 1/1] [INFO] howto ............................................. SKIPPED
[16:51:23][Step 1/1] [INFO] BaseModule ........................................ SKIPPED






6 comments
Comment actions Permalink

Please add -X  to additional command line paramteres in your maven step settings and run build again.

Attach resulting build log to this forum thread.

0
Comment actions Permalink

I'm sorry, what do you mean add -X for additional parameters?

goals has been set as below on teamcity
clean install -e -Dandroidmanifest.version.name=%androidmanifest.version.name%

as I said it works perfectly via console.

0
Comment actions Permalink

There is a special field on your Maven build step configuration page:

Additional Maven command line parameters

it is used for passing parameters other than goals.

You should move your existing params (-e -Dandroidmanifest.version.name=%androidmanifest.version.name%) to the field

Also, add a "-X" parameter to the field. This will enable debug logs for maven build and help to diagnose the underlying issue.

0
Comment actions Permalink

I did everything as you mentioned.

here are the result,

[18:10:56][com.triodor.today:today] Failed  to execute goal  org.apache.maven.plugins:maven-dependency-plugin:2.8:copy  (copy-installed) on project today: Error copying artifact from  C:\TeamCity\buildAgent\work\fbce55a8dab1cf33\Android\DailyWork\trunk\target\today_2.1.0.15_(trunk).apk  to Z:\today_2.1.0.15_(trunk).apk
[18:10:56][Step 1/1] [INFO] ------------------------------------------------------------------------
[18:10:56][Step 1/1] [INFO] Reactor Summary:
[18:10:56][Step 1/1] [INFO]

[18:10:56][Step 1/1] [INFO] zxing library ..................................... SUCCESS [1:03.109s]
[18:10:56][Step 1/1] [INFO] SlidingMenu ....................................... SUCCESS [11.210s]
[18:10:56][Step 1/1] [INFO] TriodorCommon ..................................... SUCCESS [36.286s]
[18:10:56][Step 1/1] [INFO] T4CLibrary ........................................ SUCCESS [1:39.763s]
[18:10:56][Step 1/1] [INFO] today ............................................. FAILURE [4:10.893s]
[18:10:56][Step 1/1] [INFO] howto ............................................. SKIPPED
[18:10:56][Step 1/1] [INFO] BaseModule ........................................ SKIPPED
[18:10:56][Step 1/1] [INFO] ------------------------------------------------------------------------
[18:10:56][Step 1/1] [INFO] BUILD FAILURE
[18:10:56][Step 1/1] [INFO] ------------------------------------------------------------------------
[18:10:56][Step 1/1] [INFO] Total time: 7:50.512s
[18:10:56][Step 1/1] [INFO] Finished at: Thu Mar 06 18:10:56 EET 2014
[18:10:56][Step 1/1] [INFO] Final Memory: 55M/753M
[18:10:56][Step 1/1] [INFO] ------------------------------------------------------------------------
[18:10:57][Step 1/1] [ERROR]  Failed to execute goal  org.apache.maven.plugins:maven-dependency-plugin:2.8:copy  (copy-installed) on project today: Error copying artifact from  C:\TeamCity\buildAgent\work\fbce55a8dab1cf33\Android\DailyWork\trunk\target\today_2.1.0.15_(trunk).apk  to Z:\today_2.1.0.15_(trunk).apk: Z:\today_2.1.0.15_(trunk).apk (The  system cannot find the path specified) -> [Help 1]
[18:10:57][Step 1/1] org.apache.maven.lifecycle.LifecycleExecutionException:  Failed to execute goal  org.apache.maven.plugins:maven-dependency-plugin:2.8:copy  (copy-installed) on project today: Error copying artifact from  C:\TeamCity\buildAgent\work\fbce55a8dab1cf33\Android\DailyWork\trunk\target\today_2.1.0.15_(trunk).apk  to Z:\today_2.1.0.15_(trunk).apk
[18:10:57][Step 1/1] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
[18:10:57][Step 1/1] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[18:10:57][Step 1/1] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[18:10:57][Step 1/1] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
[18:10:57][Step 1/1] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
[18:10:57][Step 1/1] at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
[18:10:57][Step 1/1] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
[18:10:57][Step 1/1] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
[18:10:57][Step 1/1] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
[18:10:57][Step 1/1] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
[18:10:57][Step 1/1] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
[18:10:57][Step 1/1] at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
[18:10:57][Step 1/1] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:10:57][Step 1/1] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[18:10:57][Step 1/1] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[18:10:57][Step 1/1] at java.lang.reflect.Method.invoke(Method.java:601)
[18:10:57][Step 1/1] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[18:10:57][Step 1/1] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[18:10:57][Step 1/1] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[18:10:57][Step 1/1] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[18:10:57][Step 1/1] Caused  by: org.apache.maven.plugin.MojoExecutionException: Error copying  artifact from  C:\TeamCity\buildAgent\work\fbce55a8dab1cf33\Android\DailyWork\trunk\target\today_2.1.0.15_(trunk).apk  to Z:\today_2.1.0.15_(trunk).apk
[18:10:57][Step 1/1] at org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:232)
[18:10:57][Step 1/1] at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.copyArtifact(CopyMojo.java:133)
[18:10:57][Step 1/1] at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.doExecute(CopyMojo.java:111)
[18:10:57][Step 1/1] at org.apache.maven.plugin.dependency.AbstractDependencyMojo.execute(AbstractDependencyMojo.java:167)
[18:10:57][Step 1/1] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)
[18:10:57][Step 1/1] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
[18:10:57][Step 1/1] ... 19 more
[18:10:57][Step 1/1] Caused by: java.io.FileNotFoundException: Z:\today_2.1.0.15_(trunk).apk (The system cannot find the path specified)          => here Z is a mapped network location, do you think it causes the problem? If it so how does it run via console without error?
[18:10:57][Step 1/1] at java.io.FileOutputStream.open(Native Method)
[18:10:57][Step 1/1] at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
[18:10:57][Step 1/1] at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
[18:10:57][Step 1/1] at org.codehaus.plexus.util.FileUtils.doCopyFile(FileUtils.java:1068)
[18:10:57][Step 1/1] at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1049)
[18:10:57][Step 1/1] at org.apache.maven.plugin.dependency.AbstractDependencyMojo.copyFile(AbstractDependencyMojo.java:228)









EDIT: When I set it to a local folder it worked. Why could I copy to another mapped network location? Why teamcity does not allow while maven console does?
0
Comment actions Permalink

Mustafa,

Mapping a network location to a drive letter is done on per-user basis in MS Windows (see this discussion)

So, unless TeamCity Agent runs using your account, mapped drive will not be visible to it.

Check the account that is used to start build agent. Please note that the default window service account can also have limitaions accessing network drives.

0
Comment actions Permalink

:/ how couldnt I think that. Yes you're right, thank you for helping. Problem solved then.

0

Please sign in to leave a comment.