Continuum

Release Project fails due to pom.xml not writable with perforce as SCM

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.1-alpha-1
  • Fix Version/s: 1.1-alpha-2
  • Component/s: Integration - Maven 2, SCM
  • Labels:
    None
  • Environment:
    ubunto 7.04 java 6
  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

All release steps from update-working-copy to map-development-versions work fine. The next phase ' rewrite-poms-for-release' fails because of read-only pom.xml.

this could be an issue with the scmUseEdit flag since perforce file are read-only by default.

see log output:
(I tried to fix alpha-2 by myself therfor log output is alpha2-SNAPSHOT, error reproduces with alpha-1, too)
[INFO] Updating local copy against the scm...
[INFO] Verifying that there are no local modifications...
[INFO] Checking dependencies and plugins for snapshots ...
[ERROR] org.apache.maven.shared.release.ReleaseExecutionException: Error writing POM: /home/drmtest/continuum-1.1-alpha-2-SNAPSHOT/continuum-webapp/src/main/webapp/WEB-INF/working-directory/1/pom.xml (Permission denied)
at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.writePom(AbstractRewritePomsPhase.java:659)
at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.writePom(AbstractRewritePomsPhase.java:604)
at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.transformProject(AbstractRewritePomsPhase.java:190)
at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.transform(AbstractRewritePomsPhase.java:115)
at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.execute(AbstractRewritePomsPhase.java:98)
at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:194)
at org.apache.maven.shared.release.DefaultReleaseManager.prepareWithResult(DefaultReleaseManager.java:107)
at org.apache.maven.continuum.release.executors.PrepareReleaseTaskExecutor.execute(PrepareReleaseTaskExecutor.java:43)
at org.apache.maven.continuum.release.executors.AbstractReleaseTaskExecutor.executeTask(AbstractReleaseTaskExecutor.java:67)
at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116)
at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: /home/drmtest/continuum-1.1-alpha-2-SNAPSHOT/continuum-webapp/src/main/webapp/WEB-INF/working-directory/1/pom.xml (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at java.io.FileWriter.<init>(FileWriter.java:73)
at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.writePom(AbstractRewritePomsPhase.java:640)
... 14 more

Issue Links

Activity

Hide
Sebastian Annies added a comment -

I added some log to the AbstractRewritePomsPhase.java source:

2007-05-18 14:52:46,186 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - We are about to write the pom
2007-05-18 14:52:46,186 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - releaseDescriptor.isScmUseEditMode(): false
2007-05-18 14:52:46,186 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - provider.requiresEditMode(): true
2007-05-18 14:52:46,186 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Okay let's make C:\svn\continuum\working-directory\1\pom.xml writable.

--> Here we execute EditScmResult result = provider.edit(repository, new ScmFileSet(new File(releaseDescriptor.getWorkingDirectory()), pomFile));

2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Edit Files: []
2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Success: true
2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Command Line: p4 -d C:\svn\continuum\working-directory\1 -u ********** -P ***************************** edit pom.xml
2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Command Output: null
2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Provider message: null

Hmm - no command output. What happens in the perforceProvider. I'll check it out. Wait for more info

Show
Sebastian Annies added a comment - I added some log to the AbstractRewritePomsPhase.java source: 2007-05-18 14:52:46,186 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - We are about to write the pom 2007-05-18 14:52:46,186 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - releaseDescriptor.isScmUseEditMode(): false 2007-05-18 14:52:46,186 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - provider.requiresEditMode(): true 2007-05-18 14:52:46,186 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Okay let's make C:\svn\continuum\working-directory\1\pom.xml writable. --> Here we execute EditScmResult result = provider.edit(repository, new ScmFileSet(new File(releaseDescriptor.getWorkingDirectory()), pomFile)); 2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Edit Files: [] 2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Success: true 2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Command Line: p4 -d C:\svn\continuum\working-directory\1 -u ********** -P ***************************** edit pom.xml 2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Command Output: null 2007-05-18 14:52:46,514 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Provider message: null Hmm - no command output. What happens in the perforceProvider. I'll check it out. Wait for more info
Hide
Sebastian Annies added a comment - - edited

the perforce adapter shows an error:
cannot find depot => using //applications/buildng-drm-roapserver/helgoland/drm-roapserver

19.5.:
2007-05-19 16:09:27,953 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release -
Command Output: Path 'C:\svn\working-directory\1\pom.xml' is not under client's root 'c:\p4\packager'.

Okay, I know what's wrong, the release-manager does not know what client it has to use and tries it with no client. That means default client. And the pom.xml it is trying to edit is not in the default client.
How can I get the client's name in the edit command!?

The checkOut command uses a client by appending -c<client>. Why doesn't the edit command?

WHAT A STUPID SITUATION. DAMN: If I add the client to the edit command the local mvn release:prepare will not run anymore since in this case a default client is used. If I don't add the client I cannot build with continuum since there we cannot use default client (since there is more than one client - Multimodule)

AAAAHHH!

Show
Sebastian Annies added a comment - - edited the perforce adapter shows an error: cannot find depot => using //applications/buildng-drm-roapserver/helgoland/drm-roapserver 19.5.: 2007-05-19 16:09:27,953 [pool-3-thread-1] ERROR ReleasePhase:rewrite-poms-for-release - Command Output: Path 'C:\svn\working-directory\1\pom.xml' is not under client's root 'c:\p4\packager'. Okay, I know what's wrong, the release-manager does not know what client it has to use and tries it with no client. That means default client. And the pom.xml it is trying to edit is not in the default client. How can I get the client's name in the edit command!? The checkOut command uses a client by appending -c<client>. Why doesn't the edit command? WHAT A STUPID SITUATION. DAMN: If I add the client to the edit command the local mvn release:prepare will not run anymore since in this case a default client is used. If I don't add the client I cannot build with continuum since there we cannot use default client (since there is more than one client - Multimodule) AAAAHHH!
Hide
Sebastian Annies added a comment - - edited

is this related to SCM-281?

Show
Sebastian Annies added a comment - - edited is this related to SCM-281?
Hide
Sebastian Annies added a comment -

I fixed this issue for myself (works for me and I don't what it may break). In the PerforceCheckOutCommand I added code for generation of a .p4config file. if P4CONFIG is set to .p4config Perforce can and will take care of finding the client by itself.

if (consumer.isSuccess()) {
File p4config = new File(workingDirectory, ".p4config");
if (!p4config.exists()) {
try { FileWriter fw = new FileWriter(p4config); fw.write("P4CLIENT=" + specname); fw.close(); } catch (IOException e) { throw new ScmException("could not create .p4config", e); }
}
return new CheckOutScmResult(cl.toString(), consumer.getCheckedout());

(But I found another flaw: Even though persistCheckout is turned on the main project's client will be changed up on release:perform. The root will be changed to workingDirectory-<somestring> , so during release:perform the client is not persistent and subsequent continous builds will change it back)

Show
Sebastian Annies added a comment - I fixed this issue for myself (works for me and I don't what it may break). In the PerforceCheckOutCommand I added code for generation of a .p4config file. if P4CONFIG is set to .p4config Perforce can and will take care of finding the client by itself. if (consumer.isSuccess()) { File p4config = new File(workingDirectory, ".p4config"); if (!p4config.exists()) { try { FileWriter fw = new FileWriter(p4config); fw.write("P4CLIENT=" + specname); fw.close(); } catch (IOException e) { throw new ScmException("could not create .p4config", e); } } return new CheckOutScmResult(cl.toString(), consumer.getCheckedout()); (But I found another flaw: Even though persistCheckout is turned on the main project's client will be changed up on release:perform. The root will be changed to workingDirectory-<somestring> , so during release:perform the client is not persistent and subsequent continous builds will change it back)
Hide
Sebastian Annies added a comment -

it works since alpha-2 - hmmm

Show
Sebastian Annies added a comment - it works since alpha-2 - hmmm

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: