jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Release Plugin
  • MRELEASE-406

release:perform ignores environment variables

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Reopened Reopened
  • Priority: Blocker Blocker
  • Resolution: Unresolved
  • Affects Version/s: 2.0-beta-8
  • Fix Version/s: None
  • Component/s: perform
  • Labels:
    None
  • Environment:
    WinXP Maven 2.0.9

Description

Our settings.xml is shared across many sites and we use reository mirrors at each of our sites.

The mirrors are setup in the settings.xml as ${proxyURL}/repopath

the users set an environment variable to point to the nexus cache at their paticular site -
eg http://maven-proxy-east.mycorp.com/nexus/content/repositories


This woks fine for normal working (compile, site deploy etc..) but release:perform fails as it tries to download from
${proxyURL}/central/org/apache/mave....

It would appear that environment variables are not passed to the forked process doing the release.

– settings.xml snippet –

<mirror>
			<id>central-mirror</id>
			<name>Maven Central [nexus mirror]</name>
			<url>${proxyURL}/central</url>
			<mirrorOf>central</mirrorOf>
		</mirror>

– end settings.xml snippet –

output from release:perfrom

D:\workspaces\TestProject>set | grep proxyURL
proxyURL=http://maven-proxy-east.mycorp.com/nexus/content/repositories

D:\workspaces\TestProject>mvn release:perform
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'release'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Test Project
[INFO]    task-segment: [release:perform] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [release:perform]
[INFO] Checking out the project to perform the release ...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive checkout https://svnserver.mycorp.com/repos/scratch/tags/testproj-0.0.1
checkout"
[INFO] Working directory: D:\workspaces\TestProject\target
[INFO] Executing goals 'deploy site-deploy'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker inst
ance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building Test Project
[INFO] [INFO]    task-segment: [deploy, site-deploy]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] Downloading: ${proxyURL}/releases/org/apache/maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.pom
[INFO] Downloading: ${proxyURL}/central/org/apache/maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.pom
[INFO] Downloading: ${proxyURL}/releases/org/apache/maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.pom
[INFO] Downloading: ${proxyURL}/thirdparty/org/apache/maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.pom
[INFO] Downloading: ${proxyURL}/central/org/apache/maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.pom
[INFO] Downloading: ${proxyURL}/codehaus/org/apache/maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.pom
[INFO] Downloading: ${proxyURL}/java.net/org/apache/maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.pom
[INFO] Downloading: ${proxyURL}/jboss/org/apache/maven/plugins/maven-deploy-plugin/2.4/maven-deploy-plugin-2.4.pom
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] BUILD ERROR
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Error building POM (may not be this project's POM).
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    mvn2.0.10_debug.log
    17/Mar/09 6:36 AM
    93 kB
    James Nord
  2. Text File
    mvn2.0.10.log
    17/Mar/09 6:21 AM
    16 kB
    James Nord
  3. Text File
    mvn2.1.0-RC3.log
    17/Mar/09 6:21 AM
    17 kB
    James Nord
  4. XML File
    pom.xml
    17/Mar/09 6:21 AM
    1 kB
    James Nord
  5. XML File
    settings.xml
    17/Mar/09 6:21 AM
    0.5 kB
    James Nord

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Sébastien Lesaint added a comment - 26/Jan/09 10:41 AM

I have the same issue, on the same version (beta-8).

I am using maven 2.1-M1.

When invoking goal release:perform, the build fails because the file "${user.home}/.ssh/id_dsa" can not be resolved.
This files stores the ssh private key used to upload the release to the remote nexus repository via scp.

It looks like variable $user.home is not passed on to the forked process.

Show
Sébastien Lesaint added a comment - 26/Jan/09 10:41 AM I have the same issue, on the same version (beta-8). I am using maven 2.1-M1. When invoking goal release:perform, the build fails because the file "${user.home}/.ssh/id_dsa" can not be resolved. This files stores the ssh private key used to upload the release to the remote nexus repository via scp. It looks like variable $user.home is not passed on to the forked process.
Hide
Permalink
James Nord added a comment - 28/Jan/09 10:23 AM

changing all the variables to env.proxyURL worked.

Strange that it can resolve environemnt variables when it's not doing the release.

Show
James Nord added a comment - 28/Jan/09 10:23 AM changing all the variables to env.proxyURL worked. Strange that it can resolve environemnt variables when it's not doing the release.
Hide
Permalink
James Nord added a comment - 17/Mar/09 6:20 AM

The issue re-appeared (must have had the artifacts in my local repo)

note: delete local repo before testing - see attached files for test project settings and output from 2.0.10 and 2.1.0-RC3

invoked with
mvn -B release:prepare release:perform

Show
James Nord added a comment - 17/Mar/09 6:20 AM The issue re-appeared (must have had the artifacts in my local repo) note: delete local repo before testing - see attached files for test project settings and output from 2.0.10 and 2.1.0-RC3 invoked with mvn -B release:prepare release:perform
Hide
Permalink
James Nord added a comment - 17/Mar/09 6:21 AM

Sample project and settings file showing the issues

Show
James Nord added a comment - 17/Mar/09 6:21 AM Sample project and settings file showing the issues
Hide
Permalink
James Nord added a comment - 17/Mar/09 6:21 AM

log files from maven (2.0.10 and 2.1.0-RC3)

Show
James Nord added a comment - 17/Mar/09 6:21 AM log files from maven (2.0.10 and 2.1.0-RC3)
Hide
Permalink
James Nord added a comment - 17/Mar/09 6:36 AM

debug output from 2.0.10

Show
James Nord added a comment - 17/Mar/09 6:36 AM debug output from 2.0.10
Hide
Permalink
Brett Porter added a comment - 17/Sep/10 10:30 PM

as you've identified, this was related to the documented Maven change.

You should use ${env.*} if you require an environment variable. However, you might better consider using it as a property, in which case you'd set it with MAVEN_OPTS="-DsomeProperty=someValue" instead of using an env. variable.

Show
Brett Porter added a comment - 17/Sep/10 10:30 PM as you've identified, this was related to the documented Maven change. You should use ${env.*} if you require an environment variable. However, you might better consider using it as a property, in which case you'd set it with MAVEN_OPTS="-DsomeProperty=someValue" instead of using an env. variable.
Hide
Permalink
James Nord added a comment - 20/Sep/10 4:26 AM

Brett: Please read comment by me from 17/Mar/09 6:20 AM.

Show
James Nord added a comment - 20/Sep/10 4:26 AM Brett: Please read comment by me from 17/Mar/09 6:20 AM.
Hide
Permalink
Brett Porter added a comment - 29/Sep/10 10:03 AM

I tried this with Maven 2.0.10 + 2.0-beta-8; 2.0.10 + 2.0; 3.0-RC3 + 2.0 - no problems on any of them.

I put your settings.xml into ~/.m2, removed the local repository, and ran the command you gave against the POM. I had to modify the settings to user /internal instead of /central as I'm using Archiva, but the env var was used. In the POM I used a different SVN repository in the SCM element and I changed the deployment URL to ${env.proxyURL}/test which worked for deployment too.

There's a possibility this is Windows specific, so I'll have to try it there. Have you tried with more recent versions of Maven and/or the release plugin?

Show
Brett Porter added a comment - 29/Sep/10 10:03 AM I tried this with Maven 2.0.10 + 2.0-beta-8; 2.0.10 + 2.0; 3.0-RC3 + 2.0 - no problems on any of them. I put your settings.xml into ~/.m2, removed the local repository, and ran the command you gave against the POM. I had to modify the settings to user /internal instead of /central as I'm using Archiva, but the env var was used. In the POM I used a different SVN repository in the SCM element and I changed the deployment URL to ${env.proxyURL}/test which worked for deployment too. There's a possibility this is Windows specific, so I'll have to try it there. Have you tried with more recent versions of Maven and/or the release plugin?

People

  • Assignee:
    Brett Porter
    Reporter:
    James Nord
Vote (4)
Watch (5)

Dates

  • Created:
    20/Jan/09 11:37 AM
    Updated:
    21/Apr/12 3:18 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.