using TeamCity6.0.1,runner Maven2 Error.

Runner Cofiguration:
Runner type:Maven2
Goals:compile
Path to a POM file:pom.xml
Other Options : Empty

--------------------------------- here is the full message of build log ----------------------------------
[19:10:38]: Checking for changes
[19:10:39]: Clearing temporary directory: E:\Program Files\TeamCity\buildAgent\temp\buildTmp
[19:10:39]: Checkout directory: F:\test
[19:10:39]: Updating sources: agent side checkout... (2s)
[19:10:39]:[Updating sources: agent side checkout...] Will perform clean checkout.
Reason: Agent doesn't have any version of the project sources
[19:10:39]: [Updating sources: agent side checkout...] Cleaning F:\test
[19:10:40]: [Updating sources: agent side checkout...] VCS Root: MarsorMavenTest (1s)
[19:10:40]: [VCS Root: MarsorMavenTest] revision: 4368_2011/01/12 19:10:38 +0800
[19:10:42]: Failed to start build runner 'Maven2'

java.lang.NullPointerException

at org.jetbrains.maven.embedder.MavenEmbedder.createLocalRepository(MavenEmbedder.java:144)

at org.jetbrains.maven.embedder.MavenEmbedder.<init>(MavenEmbedder.java:88)

at org.jetbrains.maven.embedder.MavenEmbedder.create(MavenEmbedder.java:517)

at jetbrains.buildServer.maven.MavenEmbedderSession.<init>(MavenEmbedderSession.java:39)

at jetbrains.maven.MavenBuildService.readProject(MavenBuildService.java:355)

at jetbrains.maven.MavenBuildService.beforeProcessStarted(MavenBuildService.java:305)

at jetbrains.buildServer.agent.runner2.GenericCommandLineBuildProcess.start(GenericCommandLineBuildProcess.java:58)

at jetbrains.buildServer.agent.impl.buildStages.runnerStages.start.CallRunnerStage.doBuildStage(CallRunnerStage.java:56)

at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:25)

at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor$1.callStage(RunnerStagesExecutor.java:23)

at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:68)

at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:31)

at jetbrains.buildServer.agent.impl.buildStages.RunnerStagesExecutor.doStages(RunnerStagesExecutor.java:18)

at
jetbrains.buildServer.agent.impl.buildStages.startStages.RunnerContextExecutor.callRunnerStages(RunnerContextExecutor.java:40)

at
jetbrains.buildServer.agent.impl.buildStages.startStages.ForEachBuildRunnerStage.doBuildStage(ForEachBuildRunnerStage.java:47)

at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:31)

at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor$1.callStage(BuildStagesExecutor.java:29)

at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.callRunStage(StagesExecutor.java:68)

at jetbrains.buildServer.agent.impl.buildStages.StagesExecutor.doStages(StagesExecutor.java:31)

at jetbrains.buildServer.agent.impl.buildStages.BuildStagesExecutor.doStages(BuildStagesExecutor.java:24)

at jetbrains.buildServer.agent.impl.BuildRunAction.doStages(BuildRunAction.java:65)

at jetbrains.buildServer.agent.impl.BuildRunAction.runBuild(BuildRunAction.java:48)

at jetbrains.buildServer.agent.impl.BuildAgentImpl.doActualBuild(BuildAgentImpl.java:250)

at jetbrains.buildServer.agent.impl.BuildAgentImpl.access$100(BuildAgentImpl.java:48)

at jetbrains.buildServer.agent.impl.BuildAgentImpl$1.run(BuildAgentImpl.java:223)

at java.lang.Thread.run(Unknown Source)

[19:10:42]: Publishing artifacts
[19:10:42]: [Publishing artifacts] Paths to publish: [teamcity-info.xml]
[19:10:42]: [Publishing artifacts] Sending files
[19:10:42]: Build finished

9 comments
Comment actions Permalink

Does your maven setting file on the agent machine contain path to Maven local repository?

0
Comment actions Permalink

for both the maven TeamCity build in and my own maven3.0.
I tested over and over again .

when using the maven TeamCity build in , I never changed it's configurations.

for my own maven , i tried set the local repository to e:\xxxxrepo\
and , i can build the project using command line .

mvn package

and target\Test.war apears after the command.


but never worked.

0
Comment actions Permalink

Could you please provide your settings.xml and its location?
If you don't want to show it here in the forum you can send it to teamcity-feedback@jetbrains.com

Thank you

0
Comment actions Permalink

I 've got it.

When using maven build in with teamcity, Do make sure the env variable :M2_HOME,Path  Is NOT setted.

Under OS Win7 Some Times they work together wonderfully,but It is SOMETIMES. Windows Server 2003 always appears the same .

Even if you didn't set the Env, but it fails when you filled the blanks in the Page:3 Build Step:Maven2 , which we thought would be worked :Maven home path,User settings path, Even if JDK.... I've got no patient any more to try each blank in the page . Let's believe they had tested the case that all blanks were filled with proper values.

so , if you want use maven3,or any other maven versions except the one they build in , Please move it into %teamcity%\buildAgents\plugins\Maven, do remember to Back - it - up .

I 've found no Q&A on the official site.

0
Comment actions Permalink

Hm. It's not true simply because on my local machine I have both PATH and M2_HOME set and everything works well now on Windows 7 and worked well before on Win XP and 2003. Both PATH and M2_HOME are always printed in the build log.

Two questions:

1) where did you find this text?
2) did that advice help you to fight your problem?

0
Comment actions Permalink

1). I tried myself . not found anywhere.

2). Now it works well on my site.

3). look at the pics below: Take notice that the maven versions are not the same
Notitle2.png
NoTitle.png

0
Comment actions Permalink
the normal log is as below, note that the error occurs before     ##teamcity[buildNumber '5']
When the M2_HOME and ENV variables were not used in the TeamCity program. or being used. ok?





[14:28:20]: Checking for changes
[14:28:20]: Clearing temporary directory: E:\TeamCity\buildAgent\temp\buildTmp
[14:28:20]: Checkout directory: E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe
[14:28:20]: Updating sources: server side checkout...
[14:28:20]: [Updating sources: server side checkout...] Building incremental patch for VCS root: Alex
[14:28:20]: [Updating sources: server side checkout...] Repository sources transferred
[14:28:20]: [Updating sources: server side checkout...] Updating E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe
---------------------------------------------------------  When Error occurs  The log below does not printed. -------------------------------------------------------------------------------------------------------------------------------

[14:28:20]: ##teamcity[buildNumber '5']
[14:28:20]: Using watcher: E:\TeamCity\buildAgent\plugins\mavenPlugin\maven-watcher\maven-watcher-agent.jar
[14:28:20]: MAVEN_OPTS =  -javaagent:E:\TeamCity\buildAgent\plugins\mavenPlugin\maven-watcher\maven-watcher-agent.jar -Dteamcity.dotnet.nunitlauncher1.1=E:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher1.1.exe -Dteamcity.runner.properties.file=E:\TeamCity\buildAgent\temp\buildTmp\teamcity.runner631535140186307862.properties -Dteamcity.buildType.id=bt2 -Dteamcity.build.changedFiles.file=E:\TeamCity\buildAgent\temp\buildTmp\changedFiles3022654886178207428.txt -Dbuild.number=5 -Dteamcity.build.properties.file=E:\TeamCity\buildAgent\temp\buildTmp\teamcity.build1921952654136266162.properties -Dteamcity.configuration.properties.file=E:\TeamCity\buildAgent\temp\buildTmp\teamcity.config6840886765181338727.properties -Dagent.home.dir=E:\TeamCity\buildAgent -Dteamcity.buildConfName=Alex -Dagent.work.dir=E:\TeamCity\buildAgent\work -Dteamcity.build.id=22 -Dteamcity.agent.dotnet.build_id=22 -Dagent.name=dell -Dteamcity.dotnet.platform=E:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe -Dteamcity.build.workingDir=E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe -Dbuild.vcs.number.Alex=4382 -Dteamcity.build.checkoutDir=E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe "-Duser.home=C:\Documents and Settings\Default User" -Djava.io.tmpdir=E:\TeamCity\buildAgent\temp\buildTmp -Dteamcity.dotnet.nunitaddin=E:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.NUnitAddin-NUnit "-Dteamcity.version=6.0.1 (build 15816)" -Dcom.jetbrains.maven.watcher.report.file=E:\TeamCity\buildAgent\temp\buildTmp\maven-build-info.xml -Dteamcity.dotnet.nunitlauncher=E:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe -Dfile.separator=\ -Dbuild.vcs.number.1=4382 -Dfile.encoding=GBK -Dteamcity.projectName=MarsorProject -Dteamcity.dotnet.nunitlauncher.msbuild.task=E:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll -Dteamcity.auth.userId=TeamCityBuildId=22 -Dteamcity.auth.password=fLwzW03DBZOlryYHYddYWZ5EqzlrL1EO -Duser.timezone=Asia/Shanghai "-Dos.name=Windows 2003" -Dteamcity.agent.cpuBenchmark=322 -Dteamcity.agent.dotnet.agent_url=http://localhost:9090/RPC2 -Dteamcity.tests.recentlyFailedTests.file=E:\TeamCity\buildAgent\temp\buildTmp\testsToRunFirst5144394894509819122.txt -Dpath.separator=; -Dos.version=5.2 -Dteamcity.build.tempDir=E:\TeamCity\buildAgent\temp\buildTmp -Dagent.ownPort=9090 -Duser.variant= -Duser.name=SYSTEM -Duser.language=zh -Dos.arch=x86 -Duser.country=CN -Dbuild.vcs.number=4382 -Dteamcity.dotnet.nunitlauncher2.0=E:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe -Dteamcity.dotnet.nunitlauncher2.0.vsts=E:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.VSTS.exe
[14:28:20]: M2_HOME = E:\TeamCity\buildAgent\plugins\maven
[14:28:20]: PATH = E:\TeamCity\buildAgent\plugins\maven\bin;.;E:\Program Files\PHP\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;E:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;E:\Program Files\Microsoft SQL Server\90\Tools\binn\;E:\Program Files\Microsoft SQL Server\90\DTS\Binn\;E:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;E:\Program Files\TortoiseSVN\bin;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;
[14:28:20]: JAVA_HOME = E:\Program Files\Java\jdk1.6.0_18
[14:28:20]: Starting: E:\TeamCity\buildAgent\plugins\maven\bin\mvn.bat -f E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\pom.xml -B clean package
[14:28:20]: in directory: E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe
[14:28:21]: [INFO] Scanning for projects...
[14:28:22]: [WARNING]
[14:28:22]: [WARNING] Some problems were encountered while building the effective model for marsor.model.java:Alex:war:0.0.1-SNAPSHOT
[14:28:22]: [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 127, column 11
[14:28:22]: [WARNING] The expression ${artifactId} is deprecated. Please use ${project.artifactId} instead.
[14:28:22]: [WARNING]
[14:28:22]: [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[14:28:22]: [WARNING]
[14:28:22]: [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[14:28:22]: [WARNING]
[14:28:22]: [INFO]
[14:28:22]: [INFO] ------------------------------------------------------------------------
[14:28:22]: [INFO] Building Marsor Studio Java Web Model 0.0.1-SNAPSHOT
[14:28:22]: [INFO] ------------------------------------------------------------------------
[14:28:22]: marsor.model.java:Alex (5s)
[14:28:22]: [marsor.model.java:Alex] Importing data from 'E:/TeamCity/buildAgent/work/6a9c5ccfac0c9afe/target/surefire-reports/TEST-*.xml' with 'surefire' processor
[14:28:22]: [marsor.model.java:Alex] Surefire report watcher
[14:28:22]: [Surefire report watcher] Watching paths:
[14:28:22]: [Surefire report watcher] E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\target\surefire-reports\TEST-*.xml
[14:28:22]: [marsor.model.java:Alex] [INFO]
[14:28:22]: [marsor.model.java:Alex] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ Alex ---
[14:28:22]: [marsor.model.java:Alex] [INFO] Deleting E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\target
[14:28:22]: [marsor.model.java:Alex] [INFO] Deleting E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\build\classes
[14:28:22]: [marsor.model.java:Alex] [INFO]
[14:28:22]: [marsor.model.java:Alex] [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ Alex ---
[14:28:22]: [marsor.model.java:Alex] [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[14:28:22]: [marsor.model.java:Alex] [INFO] Copying 0 resource
[14:28:22]: [marsor.model.java:Alex] [INFO]
[14:28:22]: [marsor.model.java:Alex] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ Alex ---
[14:28:22]: [marsor.model.java:Alex] [WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
[14:28:22]: [marsor.model.java:Alex] [INFO] Compiling 12 source files to E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\build\classes
[14:28:23]: [marsor.model.java:Alex] [INFO]
[14:28:23]: [marsor.model.java:Alex] [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ Alex ---
[14:28:23]: [marsor.model.java:Alex] [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[14:28:23]: [marsor.model.java:Alex] [INFO] skip non existing resourceDirectory E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\src\test\resources
[14:28:23]: [marsor.model.java:Alex] [INFO]
[14:28:23]: [marsor.model.java:Alex] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ Alex ---
[14:28:23]: [marsor.model.java:Alex] [INFO] No sources to compile
[14:28:23]: [marsor.model.java:Alex] [INFO]
[14:28:23]: [marsor.model.java:Alex] [INFO] --- maven-surefire-plugin:2.5:test (default-test) @ Alex ---
[14:28:23]: [marsor.model.java:Alex] [INFO] No tests to run.
[14:28:23]: [marsor.model.java:Alex] [INFO]
[14:28:23]: [marsor.model.java:Alex] [INFO] --- maven-war-plugin:2.1.1:war (default-war) @ Alex ---
[14:28:23]: [marsor.model.java:Alex] [INFO] Packaging webapp
[14:28:23]: [marsor.model.java:Alex] [INFO] Assembling webapp [Alex] in [E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\target\Alex]
[14:28:23]: [marsor.model.java:Alex] [INFO] Processing war project
[14:28:23]: [marsor.model.java:Alex] [INFO] Copying webapp resources [E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\web]
[14:28:25]: [marsor.model.java:Alex] [INFO] Webapp assembled in [1984 msecs]
[14:28:25]: [marsor.model.java:Alex] [INFO] Building war: E:\TeamCity\buildAgent\work\6a9c5ccfac0c9afe\target\Alex.war
[14:28:27]: [marsor.model.java:Alex] [WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored
[14:28:27]: [marsor.model.java:Alex] (webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
[14:28:27]: [INFO] ------------------------------------------------------------------------
[14:28:27]: [INFO] BUILD SUCCESS
[14:28:27]: [INFO] ------------------------------------------------------------------------
[14:28:27]: [INFO] Total time: 5.516s
[14:28:27]: [INFO] Finished at: Thu Jan 13 14:28:27 CST 2011
[14:28:27]: [INFO] Final Memory: 10M/24M
[14:28:27]: [INFO] ------------------------------------------------------------------------
[14:28:27]: Process exited with code 0
[14:28:27]: Publishing artifacts
[14:28:27]: [Publishing artifacts] Paths to publish: [E:\TeamCity\buildAgent\temp\buildTmp\.tc-maven-bi\maven-build-info.xml.gz => .teamcity]
[14:28:27]: [Publishing artifacts] Sending files
[14:28:27]: Surefire report watcher
[14:28:27]: Waiting for 1 service processes to complete
[14:28:27]: Publishing artifacts
[14:28:27]: [Publishing artifacts] Paths to publish: [teamcity-info.xml]
[14:28:27]: [Publishing artifacts] Sending files
[14:28:27]: Build finished

0
Comment actions Permalink

Remove the Env, I downloaded the maven3 from it's official site, and unziped.
do the following steps. is it ok on your machine??
I tried 3 machines, the problem is the same.

----------------------------
Even if you didn't set the Env, but it fails when you filled the blanks  in the Page:3 Build Step:Maven2 , which we thought would be worked  :Maven home path,User settings path, Even if JDK.... I've got no patient  any more to try each blank in the page . Let's believe they had tested  the case that all blanks were filled with proper values.

0
Comment actions Permalink

I probably didn't understand you right when you said "Do make sure the env variable :M2_HOME,Path  Is NOT setted." Not set where? In the OS or in the build configuration?

Also I don't completely undesrtand (perhaps completely don't understand) your further explanations. Sorry.

First, I'd like to summarize what I was able to understand from all of your posts.

You reported an exception. This exception occurred during reading the project model BEFORE any maven process has started. This error doesn't depend anyhow on a particular Maven version you were trying to execute, but it does depend on Maven settings (stored in settings.xml). The exception occurs when TeamCity cannot read the local repository path for some reason. The reason is still unclear for me, and that's what I tried to understand when I asked you about settings.xml.

The answer wasn't clear, and I asked you to send me the settings.xml so that I could see how the local repository is defined.

You replied you could shoot the problem by doing some tricks with M2_HOME, Path, etc. And all this part till the end is pretty vague.


Now could you please tell me what were your runner settings when you saw the failure and when you stopped seeing it?

Thank you.

0

Please sign in to leave a comment.