Skip to content

ZOOKEEPER-3423:use the maven-like way to ignore the generated version java files and doc the cmd:'./zkServer.sh version'#980

Closed
maoling wants to merge 4 commits intoapache:masterfrom
maoling:ZOOKEEPER-3423
Closed

ZOOKEEPER-3423:use the maven-like way to ignore the generated version java files and doc the cmd:'./zkServer.sh version'#980
maoling wants to merge 4 commits intoapache:masterfrom
maoling:ZOOKEEPER-3423

Conversation

@maoling
Copy link
Copy Markdown
Member

@maoling maoling commented Jun 11, 2019

@eolivelli eolivelli requested a review from nkalmar June 14, 2019 07:11
@eolivelli
Copy link
Copy Markdown
Contributor

I will wait for @nkalmar feedback

Another maven-like approach would be to create such files into ${project.build.directory}/generated-sources/versioninfo

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-source</goal>
            </goals>
            <configuration>
                <sources>
                    <source>${project.build.directory}/generated-sources/versioninfo</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>

.gitignore Outdated
zookeeper-client/zookeeper-client-c/ltmain.sh
zookeeper-client/zookeeper-client-c/missing
zookeeper-server/src/main/java/org/apache/zookeeper/version/Info.java
zookeeper-server/src/main/java/org/apache/zookeeper/version/VersionInfoMain.java
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed this issue during a build, good to fix. I agree with Norbert - this should be part of "generate-sources" phase/directory.

@maoling maoling changed the title ZOOKEEPER-3423:add VersionInfoMain.java to .gitignore and doc the cmd:'./zkServer.sh version' ZOOKEEPER-3423:use the maven-like way to ignore the generated version java files and doc the cmd:'./zkServer.sh version' Jun 16, 2019
@maoling maoling force-pushed the ZOOKEEPER-3423 branch 2 times, most recently from c2f9a2f to caed68e Compare June 16, 2019 10:20
@maoling
Copy link
Copy Markdown
Member Author

maoling commented Jun 17, 2019

@eolivelli Could you plz offer some help? :D

@maoling
Copy link
Copy Markdown
Member Author

maoling commented Jun 18, 2019

Ant PreCommit has failed which will be discarded? this PR works well in my local.

Copy link
Copy Markdown
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late reply.

Your change is perfect!
I left a just a comment. Please take a look.

In theory I have disabled the ant precommit but in practice it is still kicking in.
Do not consider it

rev = rev.trim();
}
generateFile(new File("."), version, rev, args[2]);
generateFile(new File("../../../target/generated-sources/java"), version, rev, args[2]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to have this path passed as a parameter, this way it will be easier to drive this code from the pom.xml

@szepet
Copy link
Copy Markdown
Contributor

szepet commented Jun 18, 2019

Neat, thanks for the documentation! :)

@phunt
Copy link
Copy Markdown
Contributor

phunt commented Jun 21, 2019

I'm afraid this causes the ant build to fail. "ant clean compile-test" failed with compilation errors.

@maoling
Copy link
Copy Markdown
Member Author

maoling commented Jun 21, 2019

Running ant clean compile-test in my local has got BUILD SUCCESSFUL. not failed?

@anmolnar
Copy link
Copy Markdown
Contributor

retest this please

@anmolnar
Copy link
Copy Markdown
Contributor

I also have compile errors with Ant:

    [javac] /Users/andormolnar/git/my-zookeeper/zookeeper-server/src/main/java/org/apache/zookeeper/Version.java:24: error: package org.apache.zookeeper.version does not exist
    [javac] public class Version implements org.apache.zookeeper.version.Info {
    [javac]                                                             ^
    [javac] /Users/andormolnar/git/my-zookeeper/zookeeper-server/src/main/java/org/apache/zookeeper/Version.java:34: error: cannot find symbol
    [javac]         return REVISION;
...

Though I've just disabled the Ant precommit job on master, so we won't see it running again.

@eolivelli
Copy link
Copy Markdown
Contributor

@maoling please fix it, it should be in the configuration of javac in build.xml you have to add the new directory

@anmolnar
Copy link
Copy Markdown
Contributor

retest ant build

1 similar comment
@anmolnar
Copy link
Copy Markdown
Contributor

retest ant build

Copy link
Copy Markdown
Contributor

@nkalmar nkalmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late entry.
This is looking good now, +1 from my side.

@nkalmar
Copy link
Copy Markdown
Contributor

nkalmar commented Jun 24, 2019

pinging @eolivelli because of his -1 on this. (I believe all concerns are fixed now).

Copy link
Copy Markdown
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure #shipit

@asfgit asfgit closed this in 4c65069 Jun 26, 2019
@nkalmar
Copy link
Copy Markdown
Contributor

nkalmar commented Jun 26, 2019

Committed to master, thanks @maoling

@maoling maoling deleted the ZOOKEEPER-3423 branch June 26, 2019 08:44
stickyhipp pushed a commit to stickyhipp/zookeeper that referenced this pull request Aug 2, 2019
…n java files and doc the cmd:'./zkServer.sh version'

- more details in the[ ZOOKEEPER-3423](https://issues.apache.org/jira/browse/ZOOKEEPER-3423)

Author: maoling <maoling199210191@sina.com>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Norbert Kalmar <nkalmar@apache.org>

Closes apache#980 from maoling/ZOOKEEPER-3423
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Aug 31, 2022
…n java files and doc the cmd:'./zkServer.sh version'

- more details in the[ ZOOKEEPER-3423](https://issues.apache.org/jira/browse/ZOOKEEPER-3423)

Author: maoling <maoling199210191@sina.com>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Norbert Kalmar <nkalmar@apache.org>

Closes apache#980 from maoling/ZOOKEEPER-3423
@maoling maoling restored the ZOOKEEPER-3423 branch September 2, 2022 11:55
RokLenarcic pushed a commit to RokLenarcic/zookeeper that referenced this pull request Sep 3, 2022
…n java files and doc the cmd:'./zkServer.sh version'

- more details in the[ ZOOKEEPER-3423](https://issues.apache.org/jira/browse/ZOOKEEPER-3423)

Author: maoling <maoling199210191@sina.com>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Norbert Kalmar <nkalmar@apache.org>

Closes apache#980 from maoling/ZOOKEEPER-3423
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 this pull request may close these issues.

6 participants