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
[BEAM-194] Add Java 8 examples archetype including mobile gaming example, with generator script #1344
Conversation
afca6ce
to
18a33eb
Compare
Caveat: it is a bit of a copy/paste/modify job. The deps from the other archetype satisfied the gaming example, which means they need to be pruned. |
Travis failures are all IWYU flake in starter archetype. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to take a peek whether we can do something that reduces the amount of code duplication.
With your (awesome) scripts, perhaps we can generate the archetype source at build time, as opposed to that code being checked in.
I'd be happy to help!
@@ -0,0 +1,94 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directory rename: java8-examples -> examples-java8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>beam-sdks-java-maven-archetypes-java8-examples</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
examples-java8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
</parent> | ||
|
||
<artifactId>beam-sdks-java-maven-archetypes-java8-examples</artifactId> | ||
<name>Apache Beam :: SDKs :: Java :: Maven Archetypes :: Java 8 Examples</name> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Examples - Java 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
</plugins> | ||
</pluginManagement> | ||
</build> | ||
<dependencies> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty line above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
<dependency> | ||
<groupId>com.google.api-client</groupId> | ||
<artifactId>google-api-client</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you double check where some of the dependencies are coming from? Starting with this one, most of the following are suspicious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that these are all dependencies of examples-java8
or examples-java
, which are both included in this archetype.
@@ -0,0 +1,164 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the third copy of the wordcount pipelines; we should try to do something better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes sense to not check these in. I don't know off the top of my head the best way to do that. Filed BEAM-1005.
@@ -0,0 +1,62 @@ | |||
<!-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd cut.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth excluding the README?
@@ -0,0 +1,131 @@ | |||
<!-- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd cut.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
852d2a8
to
1619179
Compare
I have now also configured things so the content is generated, and removed sources from both archetypes. Unfortunately the way the configuration is inherited means that the |
1619179
to
6e4c93c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great improvement!
@@ -6,6 +6,10 @@ | |||
target/ | |||
bin/ | |||
|
|||
# Ignore generated archetypes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe convention is that this goes to ${project.build.directory}/generated-sources/
, so it should not be necessary due to target/
exclusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've spent a couple minutes looking for documentation on this, and I don't think archetype:create-from-project
has a way to support putting things in generated-sources
to be instantiated to the user's src
directory.
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't belong here, right? Global plugin management?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -34,6 +34,7 @@ | |||
<modules> | |||
<module>starter</module> | |||
<module>examples</module> | |||
<module>examples-java8</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only on supported platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
2e591f7
to
e0fcb31
Compare
Both archetypes are now autogenerated and I've had local success with verification. I have included a fix of some very old and presumably obsolete configuration that was breaking things. Jenkins had a transient failure but I have kicked it. |
497db40
to
d6aa36a
Compare
It is worth noting that actually building the archetypes like this involves unix scripting so it not MS Windows friendly. We either need to check in the generated code or disable these processes on MS Windows. |
This archetype module is automatically generated during the build process, and its dependencies and tests verified.
d6aa36a
to
d93b183
Compare
I have updated the archetype parent to only run the unix-only builds on unix platforms. For now, at least this will make enthusiasts able to build the project on any platform, and users are not affected anyhow. If a Windows OS contributor would care to try to make this portable to Windows, that is welcome. |
Refer to this link for build results (access rights to CI server needed): |
This looks pretty awesome right now. High-level LGTM. Will take a closer look, but won't have anything more than low-level comments. |
LGTM Merging, since this is a clear improvement. However, java8 archetype also needs profiles to be able to run them, and possibly other fixups. Let's address them in a followup pull request. |
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull request
mvn clean verify
. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
<Jira issue #>
in the title with the actual Jira issuenumber, if there is one.
Individual Contributor License Agreement.