You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by fs111 <gi...@git.apache.org> on 2016/02/23 12:34:40 UTC

[GitHub] flink pull request: added support for Main-Class separated by / in...

GitHub user fs111 opened a pull request:

    https://github.com/apache/flink/pull/1694

    added support for Main-Class separated by / instead of .

    I ran into this while trying something out with cascading-flink:
    
    The Main-Class in a jar manifest may be written as "package/subpackage/SomeClass", which confuses the flink runner, since it assumes that classes are always written with "." as the separator.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/fs111/flink master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1694.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1694
    
----
commit f9c0f196dd115c6a8016f02a8c2f166a3f24ec0d
Author: Andre Kelpe <ef...@googlemail.com>
Date:   2016-02-23T11:31:51Z

    added support for Main-Class separated by / instead of .

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: added support for Main-Class separated by / in...

Posted by rmetzger <gi...@git.apache.org>.
Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1694#discussion_r53785222
  
    --- Diff: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java ---
    @@ -85,7 +85,8 @@ public boolean accept(File dir, String name) {
     					if (manifest != null) {
     						assemblerClass = manifest.getMainAttributes().getValue(PackagedProgram.MANIFEST_ATTRIBUTE_ASSEMBLER_CLASS);
     						if (assemblerClass == null) {
    -							assemblerClass = manifest.getMainAttributes().getValue(PackagedProgram.MANIFEST_ATTRIBUTE_MAIN_CLASS);
    +						    // Main-Class may use "/" as separator, not just "."
    +							assemblerClass = manifest.getMainAttributes().getValue(PackagedProgram.MANIFEST_ATTRIBUTE_MAIN_CLASS).replaceAll("/", "\\.");
    --- End diff --
    
    Are we sure `getValue()` always returns something != null?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: added support for Main-Class separated by / in...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the pull request:

    https://github.com/apache/flink/pull/1694#issuecomment-195000972
  
    @fs111 Any updates here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: added support for Main-Class separated by / in...

Posted by fs111 <gi...@git.apache.org>.
Github user fs111 commented on the pull request:

    https://github.com/apache/flink/pull/1694#issuecomment-196293990
  
    I try to get to this this week


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request: added support for Main-Class separated by / in...

Posted by fs111 <gi...@git.apache.org>.
Github user fs111 commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1694#discussion_r53786826
  
    --- Diff: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarListHandler.java ---
    @@ -85,7 +85,8 @@ public boolean accept(File dir, String name) {
     					if (manifest != null) {
     						assemblerClass = manifest.getMainAttributes().getValue(PackagedProgram.MANIFEST_ATTRIBUTE_ASSEMBLER_CLASS);
     						if (assemblerClass == null) {
    -							assemblerClass = manifest.getMainAttributes().getValue(PackagedProgram.MANIFEST_ATTRIBUTE_MAIN_CLASS);
    +						    // Main-Class may use "/" as separator, not just "."
    +							assemblerClass = manifest.getMainAttributes().getValue(PackagedProgram.MANIFEST_ATTRIBUTE_MAIN_CLASS).replaceAll("/", "\\.");
    --- End diff --
    
    nope, good catch. I'll give it another spin later today


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---