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

WebAPI 2.8.0 build error - .git directory is not found! Please specify a valid [dotGitDirectory] in your pom.xml #1733

Closed
mintmountain89 opened this issue Jan 6, 2021 · 6 comments · Fixed by #1757
Assignees
Milestone

Comments

@mintmountain89
Copy link

Hi there,
We are having problems building the WebAPI.war file for release 2.8.0. The message that is that the git directory is not found in the pom.xml.

image

.git directory is not found! Please specify a valid [dotGitDirectory] in your pom.xml

Thanks!

@chrisknoll
Copy link
Collaborator

@wivern, in this PR: #1453, you implemented the use of the git-commit-id-plugin. However, I believe there's an issue when you get the sourcecode from the release (as a zip), you can't build the project because it can't get the .git information. So, I think we need to skip the plugin if the project wasn't pulled from git. I read that there is support for a 'skip' option, maybe we can by default skip but for dev, enable. Or, maybe we need to externalize the git information from the build process, and commit a build info information to the repository as part of a release step?

I was looking through the documentation here, and it looks like we can make it so it doesn't fail when you don't have a git directory using this: <failOnNoGitDirectory>true</failOnNoGitDirectory>. Maybe that's an option? I don't know what happens if the plugin doesn't run and values aren't put into a property file (like the commit id).

But if we want to capture some information about the build, even for stand-alone releases without a git repo, maybe we need to set a maven goal to output the file, and we execute this as a pre-release step. Not sure what the best way is for this.

I'm definitely sure that we don't want to have a build error tho :)

@chrisknoll
Copy link
Collaborator

@mintmountain89 , in your local pom.xml file, could you try to make a local edit that may get around this error:

In the pom.xml, you have this content:

      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>4.0.0</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>revision</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <generateGitPropertiesFile>false</generateGitPropertiesFile>
        </configuration>
      </plugin>

Can you try modifying the <configuration> element:

<generateGitPropertiesFile>false</generateGitPropertiesFile>
<failOnNoGitDirectory>true</failOnNoGitDirectory>

Note: I think this will let the build pass, but it may leave null values in our application properties which may lead to NPE (null pointer exceptions) at run time, so this may not be a fix. Would you mind trying it out and letting us know?

@ParkChanghHyun
Copy link

Also you can solve this error by downloading "WebAPI" to 「git bash」.

It is link about how to install 「git bash」

And then you can follow this step.

  1. Excute 「git bash」 and change your working directory in 「git bash」
  2. Get URL to get git clone ( https://github.com/OHDSI/WebAP )
    image

3.commend "git clone https://github.com/OHDSI/WebAPI.git" in 「git bash」
image

And then if you follow /OHDSI/WebAPI/wiki installation guide,
you can solve this problem.

@mintmountain89
Copy link
Author

@chrisknoll Thanks, we tried to modify the pom.xml but it still failed to build

image

attempted the git clone command suggested by @ParkChanghHyun , that worked and the build went through

@chrisknoll
Copy link
Collaborator

chrisknoll commented Jan 8, 2021

Ok, using the git clone is fine, just checkout to the release tag 2.8.0 using the command:
git checkout v2.8.0 --
otherwise you'll be using the latest master (which is fine if you want to test something, but not if you want to use the released version).

@olga-ganina olga-ganina added this to the V2.8.1 milestone Jan 21, 2021
@mintmountain89
Copy link
Author

Thanks, @chrisknoll

ssuvorov-fls added a commit that referenced this issue Jan 25, 2021
…folder

if git_commit-id-plugin can not get git info parameters then gmaven-plugin creates these parameters with default value ("*")
(#1733)
ssuvorov-fls added a commit that referenced this issue Jan 25, 2021
anton-abushkevich pushed a commit that referenced this issue Jan 26, 2021
* git-commit-id-plugin does not throw exception in case of absent .git folder
if git_commit-id-plugin can not get git info parameters then gmaven-plugin creates these parameters with default value ("*")
(#1733)

* removed temporary dependencies
(#1733)

Co-authored-by: Sergey Suvorov <[email protected]>
chrisknoll pushed a commit that referenced this issue Feb 16, 2021
* git-commit-id-plugin does not throw exception in case of absent .git folder
if git_commit-id-plugin can not get git info parameters then gmaven-plugin creates these parameters with default value ("*")
(#1733)

* removed temporary dependencies
(#1733)

Co-authored-by: Sergey Suvorov <[email protected]>
anton-abushkevich added a commit that referenced this issue Feb 17, 2021
* prepare for release 2.8.0

* 2.8.1-SNAPSHOT

* Update CIRCE to 1.9.1

(cherry picked from commit 9fac161)

* Remove trailing ; from DELETE (#1752)

Fixes #1730.

(cherry picked from commit 66f9100)

* PLP/PLE Analysis result file missed analysis executable code #1729 (#1751)

* removed tomcat dependency from hive profile (#1748)

changed default runtime delegate
(#1720)

Co-authored-by: Sergey Suvorov <[email protected]>

* Issue 1733 build error without git dir (#1757)

* git-commit-id-plugin does not throw exception in case of absent .git folder
if git_commit-id-plugin can not get git info parameters then gmaven-plugin creates these parameters with default value ("*")
(#1733)

* removed temporary dependencies
(#1733)

Co-authored-by: Sergey Suvorov <[email protected]>

* Update org.apache.httpcomponents:httpclient version from 4.5.10 to 4.5.13 (#1747)

* eager loading is now used during conversion of entities to dto (#1763)

fixes #1758

Co-authored-by: Sergey Suvorov <[email protected]>
# Conflicts:
#	pom.xml

* GitHub actions (#1690)

* Puts Maven Central as the first repository

This speeds up the build A LOT when none of the dependencies have been
cached yet (e.g. when performing a docker build). Reason: without putting this repository first, all
dependencies are first searched in all of the specified repositories and
only afterwards the central repository is tried. Because most
dependencies are not present in the specified repositories, still
central needs to be queried afterwards. When putting the central
repository first, this reduces time to retrieve dependencies in two
ways:

1. The central repository has a very low latency, much lower than the
other repositories. If a dependency can be fetched from here, it will be
faster than when it is fetched from another one.
2. For most dependencies, it reduces the number of repositories queried
from 7 to 1.

* Enabled github actions

* Use dedicated docker profile to avoid long command line

* Backport github action fixes

* Fix typo

* Remove unsupported platform

* Only use Maven central in the webapi-docker profile

* ancestorAndDescendant:get permission is now added to new sources  (#1766)

* ancestorAndDescendant:get permission is now added to new sources
fixes #1759

* ancestorAndDescendant:get permission is now added to new sources
fixes #1759

* fixed identation
fixes #1759

* ancestorAndDescendant:get permission is not added to new sources #1759 - fix permission name

Co-authored-by: Sergey Suvorov <[email protected]>
Co-authored-by: Anton Abushkevich <[email protected]>

* ir generation results are now exported correctly (#1767)

queryForRowSet function calls isSigned function which is not implemented for hive
fixes #1765

Co-authored-by: Sergey Suvorov <[email protected]>

* Fix sql server migration.
Revert a721214.
Remove IF EXISTS from sql server.

* Update dependency to arachne-commons release 1.17.1 #1774 (#1775)

* Eager loading without redundant calls for fetching collecions works only in 5.4.2.Final version of hibernate(#1758)

# Conflicts:
#	pom.xml

* Reset Impala settings to default(#1758)

* Updated org.ohdsi from 1.9.1 to 1.9.2 to to fix error in script(#1755) (#1778)

Co-authored-by: Sergey Suvorov <[email protected]>

* Updated org.apache.shiro from 1.6.0 to 1.7.1 to eliminate identified vulnerabilities  (#1759) (#1776)

Co-authored-by: Sergey Suvorov <[email protected]>

* Version 2.8.1

Co-authored-by: anton.abushkevich <anton.abushkevich>
Co-authored-by: Chris Knoll <[email protected]>
Co-authored-by: anton-abushkevich <[email protected]>
Co-authored-by: Sergey Suvorov <[email protected]>
Co-authored-by: Joris Borgdorff <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants