{"action":"closed","number":31,"pull_request":{"url":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls/31","id":27760580,"html_url":"https://github.com/MIND-Tools/mind-compiler/pull/31","diff_url":"https://github.com/MIND-Tools/mind-compiler/pull/31.diff","patch_url":"https://github.com/MIND-Tools/mind-compiler/pull/31.patch","issue_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/issues/31","number":31,"state":"closed","locked":false,"title":"Maven support","user":{"login":"StephaneSeyvoz","id":2083744,"avatar_url":"https://avatars.githubusercontent.com/u/2083744?v=3","gravatar_id":"","url":"https://api.github.com/users/StephaneSeyvoz","html_url":"https://github.com/StephaneSeyvoz","followers_url":"https://api.github.com/users/StephaneSeyvoz/followers","following_url":"https://api.github.com/users/StephaneSeyvoz/following{/other_user}","gists_url":"https://api.github.com/users/StephaneSeyvoz/gists{/gist_id}","starred_url":"https://api.github.com/users/StephaneSeyvoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephaneSeyvoz/subscriptions","organizations_url":"https://api.github.com/users/StephaneSeyvoz/orgs","repos_url":"https://api.github.com/users/StephaneSeyvoz/repos","events_url":"https://api.github.com/users/StephaneSeyvoz/events{/privacy}","received_events_url":"https://api.github.com/users/StephaneSeyvoz/received_events","type":"User","site_admin":false},"body":"# Maven support\r\n\r\n## The problem\r\n\r\nWhen compiling maven-ized Mind applications such as https://github.com/Mind4SE/mind-maven-examples with the Mind Maven plugins https://github.com/Mind4SE/mind-parent-maven-plugin we had trouble related to using the standard \"runtime\" library.\r\n\r\nOur user projects rely on the \"mindadl-maven-plugin\" for compilation, itself depending on the mind-compiler, that maven will download the modules of. The mind-compiler project includes the \"fractal-runtime\" as a Maven module. This implies that at compiler instantiation time, all modules are loaded in the Maven classloader, including the \"fractal-runtime\" jar.\r\n\r\nThe classloader \"getResource\" policy is to search from core Java libraries and then in wider circles, towards the user space. Here, the original \"runtime\" is contributed as \"--src-path\" as one of the last Classloader entries, as visible in the SrcPathOptionHandler: https://github.com/MIND-Tools/mind-compiler/blob/master/mindc/src/main/java/org/ow2/mind/cli/SrcPathOptionHandler.java\r\n\r\nWhen searching for the Bootstrap.adl, bootstrap.c, Main.itf usual files, the classloader \"getResource\" finds the file in the loaded \"fractal-runtime\" jar first (compressed), before the user file-system entry, leading to an error (a solution could be to unpack the content and add it to the source path).\r\n\r\n## Proposed solution\r\n\r\nWe use \"getResources\" to obtain all matching resource entries from the classloader, and then flter them to keep \"files\" only (thus excluding jars).\r\nThe solution had a small side effect that is fixed in the 3rd commit.\r\n\r\n## Another possible solution / perspective ?\r\n\r\nWe could also have removed the \"fractal-runtime\" from the core compiler modules so as not to get the error, and define a specific repository for it, to build it, and add the resources in the final compiler assembly (bin zip).\r\nThis could be done in a second phase, and is anyway compatible with the current solution.\r\n\r\n## How to test the solution\r\n\r\nWe provide examples of a basic component library project and application project in the following repository: \r\nhttps://github.com/Mind4SE/mind-maven-examples\r\n\r\nThe \"App\" and \"Lib\" are provided as 2 different versions (1.0-SNAPSHOT and 1.1-SNAPSHOT), where only \"Lib\" contains component a code change (a printf is added), and the only App change is the dependency version:\r\n\r\nComponent C code change:\r\n* https://github.com/Mind4SE/mind-maven-examples/blob/master/exampleLib/src/main/mind/packagename/componentImpl.c\r\n* https://github.com/Mind4SE/mind-maven-examples/blob/master/exampleLib-1.1/src/main/mind/packagename/componentImpl.c\r\n\r\nApp POM, see line 30:\r\n* https://github.com/Mind4SE/mind-maven-examples/blob/master/exampleApp/pom.xml\r\n* https://github.com/Mind4SE/mind-maven-examples/blob/master/exampleApp-1.1/pom.xml\r\n\r\n","created_at":"2015-01-21T13:53:38Z","updated_at":"2015-02-16T16:46:54Z","closed_at":"2015-02-16T16:46:54Z","merged_at":"2015-02-16T16:46:54Z","merge_commit_sha":"d89b8087d4952f74bc0eed5ab5d5b9b039c5d397","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls/31/commits","review_comments_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls/31/comments","review_comment_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls/comments/{number}","comments_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/issues/31/comments","statuses_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/statuses/02b52280b78997c7a32e877b8e9d19c827577077","head":{"label":"Mind4SE:maven-support_jar-filter","ref":"maven-support_jar-filter","sha":"02b52280b78997c7a32e877b8e9d19c827577077","user":{"login":"Mind4SE","id":6032056,"avatar_url":"https://avatars.githubusercontent.com/u/6032056?v=3","gravatar_id":"","url":"https://api.github.com/users/Mind4SE","html_url":"https://github.com/Mind4SE","followers_url":"https://api.github.com/users/Mind4SE/followers","following_url":"https://api.github.com/users/Mind4SE/following{/other_user}","gists_url":"https://api.github.com/users/Mind4SE/gists{/gist_id}","starred_url":"https://api.github.com/users/Mind4SE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mind4SE/subscriptions","organizations_url":"https://api.github.com/users/Mind4SE/orgs","repos_url":"https://api.github.com/users/Mind4SE/repos","events_url":"https://api.github.com/users/Mind4SE/events{/privacy}","received_events_url":"https://api.github.com/users/Mind4SE/received_events","type":"Organization","site_admin":false},"repo":{"id":14689723,"name":"mind-compiler","full_name":"Mind4SE/mind-compiler","owner":{"login":"Mind4SE","id":6032056,"avatar_url":"https://avatars.githubusercontent.com/u/6032056?v=3","gravatar_id":"","url":"https://api.github.com/users/Mind4SE","html_url":"https://github.com/Mind4SE","followers_url":"https://api.github.com/users/Mind4SE/followers","following_url":"https://api.github.com/users/Mind4SE/following{/other_user}","gists_url":"https://api.github.com/users/Mind4SE/gists{/gist_id}","starred_url":"https://api.github.com/users/Mind4SE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mind4SE/subscriptions","organizations_url":"https://api.github.com/users/Mind4SE/orgs","repos_url":"https://api.github.com/users/Mind4SE/repos","events_url":"https://api.github.com/users/Mind4SE/events{/privacy}","received_events_url":"https://api.github.com/users/Mind4SE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mind4SE/mind-compiler","description":"MIND compiler modules","fork":true,"url":"https://api.github.com/repos/Mind4SE/mind-compiler","forks_url":"https://api.github.com/repos/Mind4SE/mind-compiler/forks","keys_url":"https://api.github.com/repos/Mind4SE/mind-compiler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mind4SE/mind-compiler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mind4SE/mind-compiler/teams","hooks_url":"https://api.github.com/repos/Mind4SE/mind-compiler/hooks","issue_events_url":"https://api.github.com/repos/Mind4SE/mind-compiler/issues/events{/number}","events_url":"https://api.github.com/repos/Mind4SE/mind-compiler/events","assignees_url":"https://api.github.com/repos/Mind4SE/mind-compiler/assignees{/user}","branches_url":"https://api.github.com/repos/Mind4SE/mind-compiler/branches{/branch}","tags_url":"https://api.github.com/repos/Mind4SE/mind-compiler/tags","blobs_url":"https://api.github.com/repos/Mind4SE/mind-compiler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mind4SE/mind-compiler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mind4SE/mind-compiler/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mind4SE/mind-compiler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mind4SE/mind-compiler/statuses/{sha}","languages_url":"https://api.github.com/repos/Mind4SE/mind-compiler/languages","stargazers_url":"https://api.github.com/repos/Mind4SE/mind-compiler/stargazers","contributors_url":"https://api.github.com/repos/Mind4SE/mind-compiler/contributors","subscribers_url":"https://api.github.com/repos/Mind4SE/mind-compiler/subscribers","subscription_url":"https://api.github.com/repos/Mind4SE/mind-compiler/subscription","commits_url":"https://api.github.com/repos/Mind4SE/mind-compiler/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mind4SE/mind-compiler/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mind4SE/mind-compiler/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mind4SE/mind-compiler/issues/comments/{number}","contents_url":"https://api.github.com/repos/Mind4SE/mind-compiler/contents/{+path}","compare_url":"https://api.github.com/repos/Mind4SE/mind-compiler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mind4SE/mind-compiler/merges","archive_url":"https://api.github.com/repos/Mind4SE/mind-compiler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mind4SE/mind-compiler/downloads","issues_url":"https://api.github.com/repos/Mind4SE/mind-compiler/issues{/number}","pulls_url":"https://api.github.com/repos/Mind4SE/mind-compiler/pulls{/number}","milestones_url":"https://api.github.com/repos/Mind4SE/mind-compiler/milestones{/number}","notifications_url":"https://api.github.com/repos/Mind4SE/mind-compiler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mind4SE/mind-compiler/labels{/name}","releases_url":"https://api.github.com/repos/Mind4SE/mind-compiler/releases{/id}","created_at":"2013-11-25T15:44:21Z","updated_at":"2015-02-03T09:33:30Z","pushed_at":"2015-02-10T14:47:10Z","git_url":"git://github.com/Mind4SE/mind-compiler.git","ssh_url":"git@github.com:Mind4SE/mind-compiler.git","clone_url":"https://github.com/Mind4SE/mind-compiler.git","svn_url":"https://github.com/Mind4SE/mind-compiler","homepage":null,"size":6405,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"MIND-Tools:master","ref":"master","sha":"27085abd9aca9c3950641687d024b4219148597e","user":{"login":"MIND-Tools","id":1892983,"avatar_url":"https://avatars.githubusercontent.com/u/1892983?v=3","gravatar_id":"","url":"https://api.github.com/users/MIND-Tools","html_url":"https://github.com/MIND-Tools","followers_url":"https://api.github.com/users/MIND-Tools/followers","following_url":"https://api.github.com/users/MIND-Tools/following{/other_user}","gists_url":"https://api.github.com/users/MIND-Tools/gists{/gist_id}","starred_url":"https://api.github.com/users/MIND-Tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MIND-Tools/subscriptions","organizations_url":"https://api.github.com/users/MIND-Tools/orgs","repos_url":"https://api.github.com/users/MIND-Tools/repos","events_url":"https://api.github.com/users/MIND-Tools/events{/privacy}","received_events_url":"https://api.github.com/users/MIND-Tools/received_events","type":"Organization","site_admin":false},"repo":{"id":5284141,"name":"mind-compiler","full_name":"MIND-Tools/mind-compiler","owner":{"login":"MIND-Tools","id":1892983,"avatar_url":"https://avatars.githubusercontent.com/u/1892983?v=3","gravatar_id":"","url":"https://api.github.com/users/MIND-Tools","html_url":"https://github.com/MIND-Tools","followers_url":"https://api.github.com/users/MIND-Tools/followers","following_url":"https://api.github.com/users/MIND-Tools/following{/other_user}","gists_url":"https://api.github.com/users/MIND-Tools/gists{/gist_id}","starred_url":"https://api.github.com/users/MIND-Tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MIND-Tools/subscriptions","organizations_url":"https://api.github.com/users/MIND-Tools/orgs","repos_url":"https://api.github.com/users/MIND-Tools/repos","events_url":"https://api.github.com/users/MIND-Tools/events{/privacy}","received_events_url":"https://api.github.com/users/MIND-Tools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MIND-Tools/mind-compiler","description":"MIND compiler modules","fork":false,"url":"https://api.github.com/repos/MIND-Tools/mind-compiler","forks_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/forks","keys_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/teams","hooks_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/hooks","issue_events_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/issues/events{/number}","events_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/events","assignees_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/assignees{/user}","branches_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/branches{/branch}","tags_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/tags","blobs_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/git/refs{/sha}","trees_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/statuses/{sha}","languages_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/languages","stargazers_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/stargazers","contributors_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/contributors","subscribers_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/subscribers","subscription_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/subscription","commits_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/commits{/sha}","git_commits_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/git/commits{/sha}","comments_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/comments{/number}","issue_comment_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/issues/comments/{number}","contents_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/contents/{+path}","compare_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/merges","archive_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/downloads","issues_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/issues{/number}","pulls_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls{/number}","milestones_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/milestones{/number}","notifications_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/labels{/name}","releases_url":"https://api.github.com/repos/MIND-Tools/mind-compiler/releases{/id}","created_at":"2012-08-03T10:35:40Z","updated_at":"2015-02-02T15:03:28Z","pushed_at":"2015-02-16T16:46:54Z","git_url":"git://github.com/MIND-Tools/mind-compiler.git","ssh_url":"git@github.com:MIND-Tools/mind-compiler.git","clone_url":"https://github.com/MIND-Tools/mind-compiler.git","svn_url":"https://github.com/MIND-Tools/mind-compiler","homepage":null,"size":6266,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls/31"},"html":{"href":"https://github.com/MIND-Tools/mind-compiler/pull/31"},"issue":{"href":"https://api.github.com/repos/MIND-Tools/mind-compiler/issues/31"},"comments":{"href":"https://api.github.com/repos/MIND-Tools/mind-compiler/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/MIND-Tools/mind-compiler/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/MIND-Tools/mind-compiler/statuses/02b52280b78997c7a32e877b8e9d19c827577077"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"valeriebertin","id":1893156,"avatar_url":"https://avatars.githubusercontent.com/u/1893156?v=3","gravatar_id":"","url":"https://api.github.com/users/valeriebertin","html_url":"https://github.com/valeriebertin","followers_url":"https://api.github.com/users/valeriebertin/followers","following_url":"https://api.github.com/users/valeriebertin/following{/other_user}","gists_url":"https://api.github.com/users/valeriebertin/gists{/gist_id}","starred_url":"https://api.github.com/users/valeriebertin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeriebertin/subscriptions","organizations_url":"https://api.github.com/users/valeriebertin/orgs","repos_url":"https://api.github.com/users/valeriebertin/repos","events_url":"https://api.github.com/users/valeriebertin/events{/privacy}","received_events_url":"https://api.github.com/users/valeriebertin/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":3,"additions":107,"deletions":6,"changed_files":4}}