Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScmInfo broken on Windows #33

Open
WhiteHatTux opened this issue Nov 3, 2014 · 6 comments
Open

ScmInfo broken on Windows #33

WhiteHatTux opened this issue Nov 3, 2014 · 6 comments
Labels

Comments

@WhiteHatTux
Copy link

My git scm-information is not added to the buildmetadata.xml, because of an error fetching the changes since the last commit.
scm-section in the pom.xml:

    <scm>
        <connection>scm:git:ssh://git@git.rest-of-valid-url.git</connection>
    </scm>

Output of mvn clean verify:

[INFO] --- buildmetadata-maven-plugin:1.5.0:provide-buildmetadata (generate-build-properties) @ project ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: c:\Users\user\git\project
[INFO] Executing: cmd.exe /X /C "git whatchanged --date=iso HEAD^..abd793559bb0a2a6d9f8c236aaea74e43092fe19 -- c:\Users\user\git\project"
[INFO] Working directory: c:\Users\user\git\project
[INFO] Executing: cmd.exe /X /C "git whatchanged --date=iso HEAD^..abd793559bb0a2a6d9f8c236aaea74e43092fe19 -- c:\Users\user\git\project"
[INFO] Working directory: c:\Users\user\git\project
[INFO] Executing: cmd.exe /X /C "git whatchanged --date=iso HEAD^..abd793559bb0a2a6d9f8c236aaea74e43092fe19 -- c:\Users\user\git\project"
[INFO] Working directory: c:\Users\user\git\project
[INFO] Executing: cmd.exe /X /C "git whatchanged --date=iso HEAD^..abd793559bb0a2a6d9f8c236aaea74e43092fe19 -- c:\Users\user\git\project"
[INFO] Working directory: c:\Users\user\git\project
[INFO] Executing: cmd.exe /X /C "git whatchanged --date=iso HEAD^..abd793559bb0a2a6d9f8c236aaea74e43092fe19 -- c:\Users\user\git\project"
[INFO] Working directory: c:\Users\user\git\project
[INFO] Executing: cmd.exe /X /C "git whatchanged --date=iso HEAD^..abd793559bb0a2a6d9f8c236aaea74e43092fe19 -- c:\Users\user\git\project"
[INFO] Working directory: c:\Users\user\git\project
[INFO] Writing properties 'c:\Users\user\git\project\target\build.properties'...
[INFO] Writing XML report 'c:\Users\user\git\project\target\classes\META-INF\buildmetadata.xml'...

These retries are connected to:
http://www.smartics.eu/plugins/buildmetadata-maven-plugin/1.1.6/apidocs/de/smartics/maven/plugin/buildmetadata/scm/maven/ScmAccessInfo.html#DEFAULT_RETRY_COUNT
That command does indeed return an empty set when i execute it from cmd.exe. Not to have the changes would not be such a problem for me, but it turns out, that if this command failes, the whole section of Scm-related information will be empty.
The resulting buildmetadata.xml is "attached" below.

How about just omitting this special change-information instead of omitting the whole scm-section?

I tried with the upstreams plugin Version 1.5.0.RC1 and it does work as expected with that version.

Just ask, if you require any more information
This is the buildmetadata.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<buildmetadata xmlns="http://www.smartics.de/project/process/implementation/buildmetadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.smartics.de/project/process/implementation/buildmetadata http://www.smartics.de/project/process/implementation/buildmetadata">
  <name>2014.2.00.00-20141103-SNAPSHOT</name>
  <version>2014.2.00.00-SNAPSHOT</version>
  <groupId>com.company.project</groupId>
  <artifactId>project</artifactId>
  <date>2014-11-03T00:00:00</date>
  <timestamp>1415042487620</timestamp>
  <build-year>2014</build-year>
  <project>
    <copyright-year>2014</copyright-year>
  </project>
  <scm/>
  <runtime>
    <build-server>DEV135NOB1146</build-server>
    <build-user>user</build-user>
    <os>
      <arch>x86</arch>
      <name>Windows 7</name>
      <version>6.1</version>
    </os>
    <java>
      <name>Java(TM) SE Runtime Environment</name>
      <version>1.7.0_51-b13</version>
      <vendor>Oracle Corporation</vendor>
      <vm>Java HotSpot(TM) Client VM</vm>
      <compiler>HotSpot Client Compiler</compiler>
    </java>
    <maven>
      <version>3.1.1</version>
      <execution-project>com.company.project:project:jar:2014.2.00.00-SNAPSHOT</execution-project>
      <is-excution-root>true</is-excution-root>
      <goals>
        <goal>clean</goal>
        <goal>verify</goal>
      </goals>
      <profiles>
        <profile source="settings.xml">artifactory</profile>
      </profiles>
    </maven>
  </runtime>
  <misc>
    <metadata name="build.date.pattern">dd.MM.yyyy</metadata>
  </misc>
</buildmetadata>
@sbadakhc
Copy link
Contributor

Apologies for the late response. I don't have any objections to your suggestion and will take a look at the upstream code to see if I can integrate it.

@sbadakhc
Copy link
Contributor

Hi I released version 1.5.1 and would appreciate if you can check it and report back.
Thanks in advance!

@sbadakhc sbadakhc added the bug label Mar 25, 2015
@WhiteHatTux
Copy link
Author

Hi,
now i am sorry for my late response. :-)
I checked back and have to report, that this is not fixed.
Not in 1.5.1 and not in 1.5.2.
scm is still empty.

@TheUltimateDeployer
Copy link

Hi,
we analyzed this issue. The method fetchChangeLog of the class ScmAccessInfo isn't retrieving any information with the "git whatchanged ..." command which WhiteHatTux has given in his error description. The result is an empty SCM element.
We discovered that the wrong Git commit was given on Unix build system.
Therefore we decided to migrate from the Git scm provider to JGit.

I can provide the fork next week if wanted.

@rnc
Copy link
Contributor

rnc commented Nov 13, 2015

@TheUltimateDeployer @WhiteHatTux : If you have any proposed patches that would be great. I don't have a Windows system to test on.

@TheUltimateDeployer
Copy link

@rnc: We developed the patch on behalf of a customer request and currently check whether there are legal issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants