| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta name="description" content=""> |
| <meta name="keywords" content="workspaceruntime, workspace, runtime, commands, build, run, macro, preview, url"> |
| <title>Commands and IDE Macros | Eclipse Che Documentation</title> |
| <link rel="stylesheet" href="css/syntax.css"> |
| |
| <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous"> |
| <!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">--> |
| <link rel="stylesheet" href="css/modern-business.css"> |
| <!-- Latest compiled and minified CSS --> |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> |
| <link rel="stylesheet" href="css/customstyles.css"> |
| <link rel="stylesheet" href="css/boxshadowproperties.css"> |
| <!-- most color styles are extracted out to here --> |
| <link rel="stylesheet" href="css/theme-che.css"> |
| |
| |
| <link rel="stylesheet" href="/css/coderay.css" media="screen" type="text/css"> |
| |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js" crossorigin="anonymous"></script> |
| |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js" crossorigin="anonymous"></script> |
| <script src="js/jquery.navgoco.min.js"></script> |
| |
| |
| <!-- Latest compiled and minified JavaScript --> |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> |
| <!-- Anchor.js --> |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/2.0.0/anchor.min.js" crossorigin="anonymous"></script> |
| <script src="js/toc.js"></script> |
| <script src="js/customscripts.js"></script> |
| |
| <link rel="shortcut icon" href="che/docs/images/favicon.ico"> |
| |
| <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> |
| <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> |
| <!--[if lt IE 9]> |
| <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> |
| <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> |
| <![endif]--> |
| |
| <link rel="alternate" type="application/rss+xml" title="che" href="http://0.0.0.0:4000/feed.xml"> |
| |
| <script> |
| $(document).ready(function() { |
| // Initialize navgoco with default options |
| $("#mysidebar").navgoco({ |
| caretHtml: '', |
| accordion: true, |
| openClass: 'active', // open |
| save: false, // leave false or nav highlighting doesn't work right |
| cookie: { |
| name: 'navgoco', |
| expires: false, |
| path: '/' |
| }, |
| slide: { |
| duration: 400, |
| easing: 'swing' |
| } |
| }); |
| |
| $("#collapseAll").click(function(e) { |
| e.preventDefault(); |
| $("#mysidebar").navgoco('toggle', false); |
| }); |
| |
| $("#expandAll").click(function(e) { |
| e.preventDefault(); |
| $("#mysidebar").navgoco('toggle', true); |
| }); |
| |
| }); |
| |
| </script> |
| <script> |
| $(function () { |
| $('[data-toggle="tooltip"]').tooltip() |
| }) |
| </script> |
| <script> |
| $(document).ready(function() { |
| $("#tg-sb-link").click(function() { |
| $("#tg-sb-sidebar").toggle(); |
| $("#tg-sb-content").toggleClass('col-md-9'); |
| $("#tg-sb-content").toggleClass('col-md-12'); |
| $("#tg-sb-icon").toggleClass('fa-toggle-on'); |
| $("#tg-sb-icon").toggleClass('fa-toggle-off'); |
| }); |
| }); |
| </script> |
| |
| |
| </head> |
| <body> |
| <!-- Navigation --> |
| <nav class="navbar navbar-inverse navbar-static-top"> |
| <div class="container topnavlinks"> |
| <div class="navbar-header"> |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| <a class="fa fa-home fa-lg navbar-brand" href="index.html"> <span class="projectTitle"> Eclipse Che Documentation</span></a> |
| </div> |
| <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> |
| <ul class="nav navbar-nav navbar-right"> |
| <!-- toggle sidebar button --> |
| <li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li> |
| <!-- entries without drop-downs appear here --> |
| |
| |
| |
| |
| |
| |
| |
| <li><a href="https://medium.com/eclipse-che-blog/" target="_blank">Blog</a></li> |
| |
| |
| |
| <li><a href="https://github.com/eclipse/che" target="_blank">Source Code</a></li> |
| |
| |
| |
| <!-- entries with drop-downs appear here --> |
| <!-- conditional logic to control which topnav appears for the audience defined in the configuration file.--> |
| |
| |
| <li class="dropdown"> |
| <a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Support<b class="caret"></b></a> |
| <ul class="dropdown-menu"> |
| |
| |
| <li><a href="https://github.com/eclipse/che/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Akind%2Fbug" target="_blank">Known Bugs</a></li> |
| |
| |
| |
| <li><a href="https://github.com/eclipse/che/issues/new" target="_blank">File an Issue</a></li> |
| |
| |
| |
| <li><a href="https://stackoverflow.com/questions/tagged/eclipse-che" target="_blank">Che on StackOverflow</a></li> |
| |
| |
| </ul> |
| </li> |
| |
| |
| <!-- |
| <li> |
| |
| |
| |
| <a class="email" title="Submit feedback" href="#" onclick="javascript:window.location='mailto:?subject= feedback&body=I have some feedback about the Commands and IDE Macros page: ' + window.location.href;"><i class="fa fa-envelope-o"></i> Feedback</a> |
| |
| </li> |
| --> |
| |
| <!--comment out this block if you want to hide search--> |
| <li> |
| <!--start search--> |
| <div id="search-demo-container"> |
| <input type="text" id="search-input" placeholder="search..."> |
| <ul id="results-container"></ul> |
| </div> |
| <script src="js/jekyll-search.js" type="text/javascript"></script> |
| <script type="text/javascript"> |
| SimpleJekyllSearch.init({ |
| searchInput: document.getElementById('search-input'), |
| resultsContainer: document.getElementById('results-container'), |
| dataSource: 'search.json', |
| searchResultTemplate: '<li><a href="{url}" title="Commands and IDE Macros">{title}</a></li>', |
| noResultsText: 'No results found.', |
| limit: 10, |
| fuzzy: true, |
| }) |
| </script> |
| <!--end search--> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- /.container --> |
| </nav> |
| |
| <!-- Page Content --> |
| <div class="container"> |
| <div id="main"> |
| <!-- Content Row --> |
| <div class="row"> |
| |
| |
| <!-- Sidebar Column --> |
| <div class="col-md-3" id="tg-sb-sidebar"> |
| |
| |
| <ul id="mysidebar" class="nav"> |
| <li class="sidebarTitle"> </li> |
| |
| |
| |
| |
| |
| <li> |
| <a href="#">Overview</a> |
| <ul> |
| |
| |
| |
| <li><a href="index.html">Introduction</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="quick-start.html">Getting Started</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="single-multi-user.html">Single and Multi-User Flavors</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="infra-support.html">Supported Infrastructures</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Che on Docker</a> |
| <ul> |
| |
| |
| |
| <li><a href="docker-single-user.html">Docker - Single User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="docker-multi-user.html">Docker - Multi User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="docker-config.html">Docker - Configuration</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="docker-cli.html">Docker - CLI Reference</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Che on Kubernetes</a> |
| <ul> |
| |
| |
| |
| <li><a href="kubernetes-single-user.html">Kubernetes - Single User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="kubernetes-multi-user.html">Kubernetes - Multi User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="kubernetes-config.html">Kubernetes - Configuration</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="kubernetes-admin-guide.html">Kubernetes - Admin Guide</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Che on OpenShift</a> |
| <ul> |
| |
| |
| |
| <li><a href="openshift-single-user.html">OpenShift - Single User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="openshift-multi-user.html">OpenShift - Multi User</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="openshift-config.html">OpenShift - Configuration</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="openshift-admin-guide.html">OpenShift - Admin Guide</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">User Management</a> |
| <ul> |
| |
| |
| |
| <li><a href="user-management.html">Authentication and Authorization</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="authentication.html">Security Model</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="permissions.html">Permissions</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="organizations.html">Organizations in UD</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="resource-management.html">Resource Management</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">User Guides</a> |
| <ul> |
| |
| |
| |
| <li><a href="creating-starting-workspaces.html">Creating and starting Workspaces</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="ide-projects.html">Projects</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="editor-code-assistance.html">Editor and Code-Assistance</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="dependency-management.html">Dependency Management</a></li> |
| |
| |
| |
| |
| |
| |
| <li class="active"><a href="commands-ide-macro.html">Commands and IDE Macros</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="version-control.html">Version Control</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="debug.html">Debug</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Workspace Administration</a> |
| <ul> |
| |
| |
| |
| <li><a href="what-are-workspaces.html">Workspace Overview</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="stacks.html">Workspace - Stacks</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="recipes.html">Workspace - Recipes</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="servers.html">Workspace - Servers</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="installers.html">Workspace - Installers</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="volumes.html">Workspace - Volumes Mount</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="env-variables.html">Workspace - Environment Variables</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="projects.html">Workspace - Projects</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="workspaces-troubleshooting.html">Workspace - Troubleshooting</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="workspace-data-model.html">Workspace Data Model</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Portable Workspaces</a> |
| <ul> |
| |
| |
| |
| <li><a href="chedir-getting-started.html">Chedir - Getting Started</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="why-chedir.html">Chedir - Why Chedir?</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chedir-installation.html">Chedir - Installation</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chedir-project-setup.html">Chedir - Project Setup</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chedir-up-and-down.html">Chedir - Up and Down</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chefile.html">Chedir - Chefile</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="chedir-ssh.html">Chedir - SSH</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="factories-getting-started.html">Factory - Getting Started</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="creating-factories.html">Factory - Creating</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="factories_json_reference.html">Factory - JSON Reference</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Developer Guides</a> |
| <ul> |
| |
| |
| |
| <li><a href="framework-overview.html">Overview</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="rest-api.html">SDK - REST API</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="che-in-che-quickstart.html">SDK - Your First Plugin</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="build-reqs.html">SDK - Building Che</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="assemblies.html">SDK - Assemblies</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="logging.html">SDK - Logging</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="ide-extensions-gwt.html">SDK - GWT IDE Extensions</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="server-side-extensions.html">SDK - Server Side Extensions</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="custom-installers.html">SDK - Installers</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="project-types.html">SDK - Project Types</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="language-servers.html">SDK - Language Support</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="parts.html">IDE UI: Parts</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="actions.html">IDE UI: Actions</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Dev Essentials</a> |
| <ul> |
| |
| |
| |
| <li><a href="guice.html">Dependency Injection</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="dto.html">Transport: DTO</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="json-rpc.html">Communication: JSON-RPC</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="handling-projects-in-plugins.html">Handling Projects in Plugins</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="dao.html">Persistence, DAO</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="properties.html">Properties</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <li> |
| <a href="#">Infrastructure and SPI</a> |
| <ul> |
| |
| |
| |
| <li><a href="spi_overview.html">Overview</a></li> |
| |
| |
| |
| |
| |
| |
| <li><a href="spi-implementation.html">Implementation Notes</a></li> |
| |
| |
| |
| |
| </ul> |
| </li> |
| |
| |
| |
| <!-- if you aren't using the accordion, uncomment this block: |
| <p class="external"> |
| <a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a> |
| </p> |
| --> |
| </ul> |
| |
| <!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.--> |
| <script>$("li.active").parents('li').toggleClass("active");</script> |
| |
| </div> |
| |
| |
| |
| |
| <!-- Content Column --> |
| <div class="col-md-9" id="tg-sb-content"> |
| <div class="post-header"> |
| <h1 class="post-title-main">Commands and IDE Macros</h1> |
| </div> |
| |
| |
| |
| <div class="post-content"> |
| |
| |
| |
| |
| |
| <!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. --> |
| <script> |
| $( document ).ready(function() { |
| // Handler for .ready() called. |
| $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2' }); |
| /* this offset helps account for the space taken up by the floating toolbar. */ |
| $('#toc').on('click', 'a', function() { |
| var target = $(this.getAttribute('href')) |
| , scroll_target = target.offset().top |
| $(window).scrollTop(scroll_target - 10); |
| return false |
| }) |
| |
| }); |
| </script> |
| |
| <div id="toc"></div> |
| |
| |
| |
| |
| <!-- |
| |
| |
| --> |
| |
| <div class="paragraph"> |
| <p>Commands are script-like instructions that are injected into the workspace machine for execution. Commands are saved in the configuration storage of your workspace and are part of any workspace export.</p> |
| </div> |
| <div class="sect1"> |
| <h2 id="command-overview">Command Overview</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>A command is defined by:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>A set of instructions to be injected into the workspace machine for execution<br></p> |
| </li> |
| <li> |
| <p>A goal to organize commands for your workflow<br></p> |
| </li> |
| <li> |
| <p>A context to scope the command to particular project(s)<br></p> |
| </li> |
| <li> |
| <p>A previewURL which to expose URL of a running server</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="command-goals">Command Goals</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>A command is executed by the developer to achieve a particular step from his flow. We provide the ability to organize commands per goal:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><em>Build</em>: Commands that build a workspace’s projects.<br></p> |
| </li> |
| <li> |
| <p><em>Test</em>: Commands related to test execution.<br></p> |
| </li> |
| <li> |
| <p><em>Run</em>: Commands that run a workspace’s projects.<br></p> |
| </li> |
| <li> |
| <p><em>Debug</em>: Commands used to start a debugging session.<br></p> |
| </li> |
| <li> |
| <p><em>Deploy</em>: Commands that are used to deploy a workspace’s projects onto specific servers or services.<br></p> |
| </li> |
| <li> |
| <p><em>Common</em>: General purpose commands.</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="command-context">Command Context</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>All commands are not applicable to every project. So we wanted to add the notion of context to a command. The context of a command defines the project(s) that the command can be used with. For example: a maven build command will be relevant only if the project is using maven.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="managing-commands">Managing Commands</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Workspace commands are available thought the <code>Commands Explorer</code> accessible from the left pane where they are organized by goal.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/commands/command-explorer.png" alt="command explorer"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>You can create new commands by using the <code>+</code> button display next to each goals. Alternatively, you can select a command from the tree to edit, duplicate or delete it.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/commands/command-editor.png" alt="command editor"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The command editor is handled as another tab in the existing editor pane. You get more space to configure the command and benefit from the full screen edit mode (by double clicking on the tab) and the ability to split vertically or horizontally to display multiple editors at the same time.</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p><strong>Name</strong>: Command name as to be unique in your workspace. The name is not restricted to camelCase.<br></p> |
| </li> |
| <li> |
| <p><strong>Intructions</strong>: Learn more about instructions and <a href="#macros">macros</a>.<br></p> |
| </li> |
| <li> |
| <p><strong>Goal</strong>: Use the dropdown to change the goal of the command.<br></p> |
| </li> |
| <li> |
| <p><strong>Context</strong>: By default, the command is available with all project(s) of the workspace. You can scope the command to be available only for selected project(s).<br></p> |
| </li> |
| <li> |
| <p><strong>Preview</strong>: Learn more about <a href="servers.html">previews</a>.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>Che provides macros that can be used within a command or preview URL to reference workspace objects. Learn more <a href="#macros">here</a>.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="macros-list">Macros list</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>When editing a command, you can get an access to all the macros that can be used in the command’s instructions or in the preview URL. To display the complete list of macros, click on the <code>Macros</code> link.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/commands/command-macros-list.png" alt="command macros list"> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="macros-auto-completion">Macros Auto-Completion</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>You can get auto-complete for all macros used in the editor. To activate this feature hit <code><Ctrl+Space></code> this will bring up a menu listing all the possible macros based on what’s been typed.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/commands/command-macros-autocompletion.png" alt="command macros autocompletion"> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="use-commands">Use Commands</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>You can use commands from multiple widgets:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Command palette<br></p> |
| </li> |
| <li> |
| <p>Command toolbar<br></p> |
| </li> |
| <li> |
| <p>Contextual menu in project explorer</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="command-palette">Command Palette</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Since commands are often run in the heat of coding, you can use a hotkey to open the command palette.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/commands/command-palette.png" alt="command palette"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The command palette allows to quickly select a command to be executed. To call the command palette from the keyboard hit <code><shift+F10></code> and then use the cursor keys to navigate and enter to execute the command.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="command-toolbar">Command Toolbar</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The command toolbar provides a way to execute the most common <code>Run</code> and <code>Debug</code> goals. It also provides access to all the executed commands and previews from a single place.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/commands/command-toolbar.png" alt="command toolbar"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Run and Debug Buttons</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>If you have commands defined for those goals, you can trigger them directly from those buttons.</p> |
| </div> |
| <div class="paragraph"> |
| <p>If you have multiple commands defined for the <code>Run</code> goal and if it’s the first time you are using the <code>Run</code> button, you’ll be asked to choose the default command associated with the button. The next click on the button will trigger the previously selected command.</p> |
| </div> |
| <div class="paragraph"> |
| <p>By doing a long click on the button you can select the command from the <code>Run</code> goal to execute. This command will become the default command associated with the <code>Run</code> button.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The same mechanisms apply to the <code>Debug</code> button.</p> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Command Controller</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>The command controller allow you to see the state of the workspace and the last command executed. You can see since how long the command started and also decide if it should be stopped or relaunched.</p> |
| </div> |
| <div class="paragraph"> |
| <p>When multiple commands have been executed it’s possible to see the list of all previously executed commands by clicking on the widget.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/commands/command-toolbar-expanded.png" alt="command toolbar expanded"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>To clean the list, remove the command’s process from the list of processes.</p> |
| </div> |
| <div class="imageblock"> |
| <div class="content"> |
| <img src="/che/docs/images/commands/command-clean-toolbar.png" alt="command clean toolbar"> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p><strong>Preview Button</strong></p> |
| </div> |
| <div class="paragraph"> |
| <p>If you have a command which start servers (for example, Tomcat) you can define the preview URL to access the running server. Learn more at <a href="servers.html#preview-urls">server preview URLs</a>.</p> |
| </div> |
| <div class="paragraph"> |
| <p>The preview button provides quick access to all the servers that are running in workspace’s machines.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="authoring-command-instructions">Authoring Command Instructions</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>A command may contain a single instruction or a succession of commands. For example:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre># each command starts from a new line |
| cd /projects/spring |
| mvn clean install |
| |
| # a succession of several commands where `;` stands for a new line |
| cd /projects/spring; mvn clean install |
| |
| # a succession of several commands where execution of a subsequent command depends on execution of a preceeding one - if there's no /projects/spring directory, `mvn clean install` won't be executed |
| cd /projects/spring && mvn clean install</pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>It is possible to check for conditions, use for loops and other bash syntax:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre># copy build artifact only if build is a success |
| mvn -f ${current.project.path} clean install |
| if [[ $? -eq 0 ]]; then |
| cp /projects/kitchensink/target/*.war /home/user/wildfly-10.0.0.Beta2/standalone/deployments/ROOT.war |
| echo "BUILD ARTIFACT SUCCESSFULLY DEPLOYED..." |
| else |
| echo "FAILED TO DEPLOY NEW ARTIFACT DUE TO BUILD FAILURE..." |
| fi</pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="macros">Macros</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Che provides macros that can be used within a command or preview URL to reference workspace objects. Macros are translated into real values only when used in the IDE! You cannot use macros in commands that are launched from server side.</p> |
| </div> |
| <table class="tableblock frame-all grid-all stretch"> |
| <colgroup> |
| <col style="width: 50%;"> |
| <col style="width: 50%;"> |
| </colgroup> |
| <thead> |
| <tr> |
| <th class="tableblock halign-left valign-top">Macro</th> |
| <th class="tableblock halign-left valign-top">Details</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${current.project.path}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Absolute path to the project or module currently selected in the project explorer tree.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${current.project.eldest.parent.path}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Absolute path to a project root (for example, in Maven multi module project)</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${current.class.fqn}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">The fully qualified package.class name of the Java class currently active in the editor panel.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${current.project.relpath}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">The path to the currently selected project relative to <code>/projects</code>. Effectively removes the <code>/projects</code> path from any project reference.</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${editor.current.file.name}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Currently selected file in editor</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${editor.current.file.basename}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Currently selected file in editor without extension</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${editor.current.file.path}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Absolute path to the selected file in editor</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${editor.current.file.relpath}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Path relative to the <code>/projects</code> folder to the selected file in editor</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${editor.current.project.name}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Project name of the file currently selected in editor</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${editor.current.project.type}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Project type of the file currently selected in editor</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${explorer.current.file.name}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Currently selected file in project tree</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${explorer.current.file.basename}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Currently selected file in project tree without extension</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${explorer.current.file.path}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Absolute path to the selected file in project tree</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${explorer.current.file.relpath}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Path relative to the <code>/projects</code> folder in project tree</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${explorer.current.project.name}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Project name of the file currently selected in explorer</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${java.main.class}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Path to the main class</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${machine.dev.hostname}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Current machine host name</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${project.java.classpath}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Project classpath</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${project.java.output.dir}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Path to Java project output dir</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${project.java.sourcepath}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Path to Java project source dir</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${explorer.current.project.type}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Project type of the file currently selected in explorer</p></td> |
| </tr> |
| <tr> |
| <td class="tableblock halign-left valign-top"><p class="tableblock"><code>${server.<serverName>}</code></p></td> |
| <td class="tableblock halign-left valign-top"><p class="tableblock">Returns protocol, hostname and port of an internal server. <code><port></code> is defined by the same internal port of the internal service that you have exposed in your workspace recipe.<br></p></td> |
| </tr> |
| </tbody> |
| </table> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Returns the hostname and port of a service or application you launch inside of a machine.<br></p> |
| </li> |
| <li> |
| <p>The hostname resolves to the hostname or the IP address of the workspace machine. This name varies depending upon where Docker is running and whether it is embedded within a VM.<br></p> |
| </li> |
| <li> |
| <p>The port returns the Docker ephemeral port that you can give to your external clients to connect to your internal service. Docker uses ephemeral port mapping to expose a range of ports that your clients may use to connect to your internal service. This port mapping is dynamic. In case of OpenShift a route will be returned.<br> |
| | <code>${workspace.name}</code> | Returns the name of the workspace<br> |
| | <code>${workspace.namespace}</code> | Workspace namespace (defaults to <code>che</code> in single user Che)</p> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="environment-variables">Environment Variables</h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>The workspace machine has a set of system environment variables that have been exported. They are reachable from within your command scripts using <code>bash</code> syntax.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre># List all available machine system environment variables |
| export |
| |
| # Reference an environment variable, where $TOMCAT_HOME points to /home/user/tomcat8 |
| $TOMCAT_HOME/bin/catalina.sh run</pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| <div class="tags"> |
| |
| <b>Tags: </b> |
| |
| |
| |
| <a href="tag_workspace.html" class="btn btn-default navbar-btn cursorNorm" role="button">workspace</a> |
| |
| |
| |
| <a href="tag_runtime.html" class="btn btn-default navbar-btn cursorNorm" role="button">runtime</a> |
| |
| |
| |
| </div> |
| |
| <!-- |
| --> |
| |
| </div> |
| |
| <hr class="shaded"/> |
| |
| <footer> |
| <div class="row"> |
| <div class="col-lg-12 footer"> |
| Eclipse Che - Documentation <br/> |
| Site last generated: Sep 13, 2018 <br/> |
| <hr> |
| <a href="http://www.eclipse.org" target="_blank">Eclipse Foundation</a><br/> |
| <a href="http://www.eclipse.org/legal/privacy.php" target="_blank">Privacy Policy</a><br/> |
| <a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">Terms of Use</a><br/> |
| <a href="https://www.eclipse.org/legal/epl-2.0/" target="_blank">Eclipse Public License</a><br/> |
| <a href="http://www.eclipse.org/legal" target="_blank">Legal Resources</a><br/> |
| </div> |
| </div> |
| </footer> |
| |
| |
| |
| |
| <!-- /.row --> |
| </div> |
| <!-- /.container --> |
| </div> |
| <!-- /#main --> |
| </div> |
| |
| </body> |
| |
| </html> |