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

How to configure plugin execution so that maven sequence do not break? #392

Closed
dishesh opened this issue Oct 22, 2018 · 4 comments
Closed
Milestone

Comments

@dishesh
Copy link

dishesh commented Oct 22, 2018

Description

Hi I am using git commit plugin to store details of commit in a properties file and then read this file to compute some logic. I am using jgit flow plugin to manage git cycles in my development process. When I feature finish my branch it does all the process but it throws exception as the plugin have changed the file which is not committed and hence breaks the process. I can not ignore the file as I need it inside some specific resources package.

Expected behavior

  • I want the plugin to update the file without breaking the process, as I will need updated commit details when feature finish or release finish.
@TheSnoozer
Copy link
Collaborator

TheSnoozer commented Oct 22, 2018

Hi,
thanks for reporting your issue here.
Based on the context provided I don't quite understand what is not working (within the plugin) and especially what you expect differently. I don't quite understand yet how the plugin would fail based on the git workflow being used.

but it throws exception as the plugin have changed the file which is not committed and hence breaks the process.

What process throws what exception?
Is it the plugin or the jgit flow plugin?

Is there a (public) project where this issue can be reproduced?
Please include any stack-traces or any error messages and furthermore please provide a description of what you expected to happen.

@dishesh
Copy link
Author

dishesh commented Oct 23, 2018

The problem is not the plugin, but how can we skip it for some specific goals of maven execution ?
Problem is that when merging my branch to develop using jgitflow plugin , plugin even stores commit values for that operation, hence making the execution goal failure for feature finish.

Checkout Conflict Exception at the end of process. Sorry there is not any public project to reproduce the event.

@TheSnoozer
Copy link
Collaborator

TheSnoozer commented Oct 23, 2018

how can we skip it for some specific goals of maven execution ?

That sounds like you need maven profiles, where different things happen based on a different context.

One way to achieve something like this with profiles (really basic example) could be achieved with leveraging the skip parameter of the plugin configuration and define a global property that is getting overwritten by the profile when it is activated (in the following case this would be runGitCommitIdPlugin).

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
.....
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <runGitCommitIdPlugin>true</runGitCommitIdPlugin>
    </properties>
.....
    <profiles>
        <profile>
            <id>skipPlugin</id>
            <properties>
                <runGitCommitIdPlugin>false</runGitCommitIdPlugin>
            </properties>
        </profile>
    </profiles>
.....
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <!-- GIT COMMIT ID PLUGIN CONFIGURATION -->
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>2.2.5</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <skip>${runGitCommitIdPlugin}</skip>
                    <!-- whatever other config -->
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
...
</project>

I understand this example is somewhat not complete, but takes advantage that you use this plugin on a global level and have it disabled when a specific profile is activated. Once the profile is active it should overwrite the custom skip property and make the plugin skip the execution.

There are various ways on activate profiles (either by command line mvn clean package -P<profile-name> or by some sort of activation rules when a file is present).

Alternatively with version 2.2.3 you can also skip the plugin by using the command line option -Dmaven.gitcommitid.skip=true.

See https://maven.apache.org/guides/introduction/introduction-to-profiles.html for further information on profiles.

@TheSnoozer
Copy link
Collaborator

I would assume you solved the issue by now.
Feel free to reopen the issue if you have further questions about 'how to exclude the plugin'

@TheSnoozer TheSnoozer added this to the 3.0 milestone Nov 1, 2018
kazuyukitanimura pushed a commit to apache/datafusion-comet that referenced this issue Jun 5, 2024
## Which issue does this PR close?
Closes #503
Closes #191 

## Rationale for this change

1. Provide a way to build Comet from the source on an isolated environments with an access to github.com
2. Update documentation in part, related to compatibility of Spark AQE and Comet Shuffle

## What changes are included in this PR?

- Update tuning section about the compatibility of Shuffle and Spark AQE
- Add `release-nogit` for building on an isolated environments
- Update docs in the section about an installation process


 Changes to be committed:
	modified:   Makefile
	modified:   docs/source/user-guide/installation.md
	modified:   docs/source/user-guide/tuning.md

## How are these changes tested?

I run both `make release` and `make release-nogit`. The first one created properties file in `common/target/classes` but the second did not. The flag `-Dmaven.gitcommitid.skip=true` is described in [this comment](git-commit-id/git-commit-id-maven-plugin#392 (comment)).
himadripal pushed a commit to himadripal/datafusion-comet that referenced this issue Sep 7, 2024
## Which issue does this PR close?
Closes apache#503
Closes apache#191 

## Rationale for this change

1. Provide a way to build Comet from the source on an isolated environments with an access to github.com
2. Update documentation in part, related to compatibility of Spark AQE and Comet Shuffle

## What changes are included in this PR?

- Update tuning section about the compatibility of Shuffle and Spark AQE
- Add `release-nogit` for building on an isolated environments
- Update docs in the section about an installation process


 Changes to be committed:
	modified:   Makefile
	modified:   docs/source/user-guide/installation.md
	modified:   docs/source/user-guide/tuning.md

## How are these changes tested?

I run both `make release` and `make release-nogit`. The first one created properties file in `common/target/classes` but the second did not. The flag `-Dmaven.gitcommitid.skip=true` is described in [this comment](git-commit-id/git-commit-id-maven-plugin#392 (comment)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants