-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-1379: [Java] adding maven-dependency-plugin and fixing all reported dependency errors #978
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
Conversation
|
I can see the build is failing but not because of my changes. Getting same error on master: |
|
One of @jacques-n, @StevenMPhillips, @siddharthteotia should take a look at this |
|
@siddharthteotia, can you troubleshoot the master build for this? |
|
apologies, master builds ok, I confused myself when checking (was too late hour for me). and this actually is problem of my PR as the dependency plugin collides with another instance in arrow-format which is using it to pull the flatc.exe. please leave it with me to resolve and sorry again. |
|
Looks the Current state of this PR:
|
| <flatc.download.skip>false</flatc.download.skip> | ||
| <flatc.executable>${project.build.directory}/flatc-${os.detected.classifier}-${fbs.version}.exe</flatc.executable> | ||
| <flatc.generated.files>${project.build.directory}/generated-sources/flatc</flatc.generated.files> | ||
| <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version> |
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.
why remove
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 don't see any references to this property anywhere so thought this is some leftover garbage?
| <flatc.executable>${project.build.directory}/flatc-${os.detected.classifier}-${fbs.version}.exe</flatc.executable> | ||
| <flatc.generated.files>${project.build.directory}/generated-sources/flatc</flatc.generated.files> | ||
| <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version> | ||
| <maven-dependency-plugin.version>2.10</maven-dependency-plugin.version> |
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 here. I think we added both of these previously since some versions of mvn 3 caused issues without these.
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.
re the dependency plugin - I defined the dependency plugin globals in the pluginManagement in the parent pom, this way it gets propagate to all instances of this plugin in child poms.
re the compiler - see my separate answer above. if it is desirable to stick it to particular version I would recommend putting it into the pluginManagement section of the parent similarly to what I did with the dependency plugin.
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 it already is in pluginManagement (as I updated it for Java9 support) in the parent pom
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 knew I saw it somewhere
java/pom.xml
Outdated
| <forkCount>2</forkCount> | ||
| <jackson.version>2.7.9</jackson.version> | ||
| <dep.jackson.version>2.7.9</dep.jackson.version> | ||
| <hadoop.version>2.7.1</hadoop.version> |
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.
missed "dep." here
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.
are you referring to the hadoop.version? I didn't touch that one actually. I was tempted to prepend it with dep. to make it consistent with the rest but thought it is out of scope of my PR... happy to do that though.
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.
hadoop.version now renamed to dep.hadoop.version. this still leaves the fbs.version in its original form without the prefix, not sure if that should be renamed too but it is kind of special one so I am leaving it
java/pom.xml
Outdated
| <execution> | ||
| <id>validate</id> | ||
| <phase>validate</phase> | ||
| <id>analyze</id> |
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.
please describe the purpose for all the checkstyle changes
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.
actually no changes to the checkstyle plugin configuration. this is just the git diff making it to look very confusing as it is mixing lines from different part in the diff report... these changes actually belong to the dependency plugin, not the checkstyle. see the full pom.
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 don't think there's any reason not to run the dependency plugin in the parent pom, so maybe the plugin could be configured in the parent (and inherited by children) instead of each child declaring the plugin?
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.
that was actually my very first approach as well but the arrow-format is already using the maven-dependency-plugin and its goal copy to fetch the flatc.exe. if I run the dependency plugin in the parent pom (with the analyze-only goal) then it shadows the copy goal instance in the arrow-format child.
I was trying to configure it so that the arrow-format is just extending the configuration adding/merging the copy goal execution with the inherited analyze-only global execution but had no luck with any sensible approach (it is only possible to reduce/activate some executions in child pom by overriding its phase to/from none but not adding completely new one; so the only possible way would be defining the plugin in the root pom with both analyze-only execution (for global dependency enforcements as per tis subj) and also the copy execution (ie with phase being none so that it can be used in the arrow-format child (setting the phase only in that module to generate-source) - but specifying the copy-flatc execution in the parent pom would be ugly, hence my final approach with defining the analyze-only execution in pluginManagement and letting each module to instantiate (and override) it itself).
so if you know a way to move it to the parent while having arrow-format still pulling the flatc.exe correctly that would indeed be my preferred way also...
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 suspect a maven bug here: when adding an execution for dependency plugin in the parent pom, the execution copy-flatc is moved after script-chmod. The merge is okay, but the order is wrong (Maven is supposed to use declaration order).
One way to workaround this would be move copy-flatc to an earlier phase like initialize.
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 like this approach - having the analyze-only execution directly in the parent pom is much better and moving the copy-flatc to initialize looks almost like the right phase anyway.
so this is now in place in this PR.
java/vector/pom.xml
Outdated
| <executions> | ||
| <execution> | ||
| <id>analyze</id> | ||
| <configuration> |
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.
Instead, let's fix vector/src/main/codegen//includes/vv_imports.ftl to remove the unnecessary import
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.
👍 nice catch, done.
java/tools/pom.xml
Outdated
| <groupId>ch.qos.logback</groupId> | ||
| <artifactId>logback-classic</artifactId> | ||
| <version>1.2.3</version> | ||
| <scope>run</scope> |
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 fix the scope too? (it's runtime, not run)
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.
|
LGTM (non-binding) |
|
cool, @jacques-n, last look? We will want to harden this in downstream projects before releasing 0.7.0 in case there are any problems |
|
LGTM too |
…rted dependency errors There is couple of dependency issues in the current maven config. This is then leaking into the integrating project which then needs to specify foreign dependencies just because arrow doesn't list them properly or is pulling unnecessary dependencies just because arrow lists them improperly. * ```arrow-format``` ``` [WARNING] Unused declared dependencies found: [WARNING] org.slf4j:slf4j-api:jar:1.7.25:compile [WARNING] com.vlkan:flatbuffers:jar:1.2.0-3f79e055:compile [WARNING] io.netty:netty-handler:jar:4.0.49.Final:compile [WARNING] com.google.guava:guava:jar:18.0:compile ``` * ```arrow-memory``` ``` [WARNING] Used undeclared dependencies found: [WARNING] io.netty:netty-buffer:jar:4.0.49.Final:compile [WARNING] io.netty:netty-common:jar:4.0.49.Final:compile [WARNING] Unused declared dependencies found: [WARNING] com.carrotsearch:hppc:jar:0.7.2:compile [WARNING] io.netty:netty-handler:jar:4.0.49.Final:compile ``` * ```arrow-tools``` ``` [WARNING] Used undeclared dependencies found: [WARNING] com.fasterxml.jackson.core:jackson-databind:jar:2.7.9:compile [WARNING] com.fasterxml.jackson.core:jackson-core:jar:2.7.9:compile [WARNING] Unused declared dependencies found: [WARNING] org.apache.commons:commons-lang3:jar:3.6:compile [WARNING] org.apache.arrow:arrow-format:jar:0.7.0-SNAPSHOT:compile [WARNING] io.netty:netty-handler:jar:4.0.49.Final:compile ``` * ```arrow-vector``` ``` [WARNING] Used undeclared dependencies found: [WARNING] com.google.code.findbugs:jsr305:jar:3.0.2:compile [WARNING] com.vlkan:flatbuffers:jar:1.2.0-3f79e055:compile [WARNING] io.netty:netty-common:jar:4.0.49.Final:compile [WARNING] io.netty:netty-buffer:jar:4.0.49.Final:compile [WARNING] com.fasterxml.jackson.core:jackson-core:jar:2.7.9:compile [WARNING] Unused declared dependencies found: [WARNING] org.apache.commons:commons-lang3:jar:3.6:compile [WARNING] io.netty:netty-handler:jar:4.0.49.Final:compile ``` I am proposing this PR to: 1. Add maven-dependency-plugin to enforce all dependencies are always listed corrctly 2. Fixing all the current dependency issues Author: Antony Mayi <[email protected]> Author: Stepan Kadlec <[email protected]> Closes apache#978 from antonymayi/master and squashes the following commits: d7f081e [Antony Mayi] moving `copy-flatc` to initialize phase and `analyze` execution to parent pom ec72717 [Antony Mayi] removing unused apache.commons.lang3, fixing pom 8cbfe5f [Antony Mayi] maven-dependency-plugin: ignoring dependencies of generated sources in arrow-vector dc833bb [Stepan Kadlec] adding maven-dependency-plugin and fixing all reported dependency errors
There is couple of dependency issues in the current maven config. This is then leaking into the integrating project which then needs to specify foreign dependencies just because arrow doesn't list them properly or is pulling unnecessary dependencies just because arrow lists them improperly.
arrow-formatarrow-memoryarrow-toolsarrow-vectorI am proposing this PR to: