blob: 1408f57534376d99a68cc1b6c8dadc778b11ae7d [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-112407000-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-112407000-2');
</script>
<!-- Google Tag Manager -->
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
'gtm.start': new Date().getTime(),
event: 'gtm.js'
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-KS8HHSF');
</script>
<!-- End Google Tag Manager -->
<head>
<title>Importing existing projects | Codewind</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Importing existing projects">
<meta name="keywords" content="importing, directory, archive, configuring, cloud, microservices, application, Eclipse, MicroProfile, Java, Spring, Node.js, Swift, Maven, Dockerfile, GitHub..."/>
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:300,400,600&display=swap" rel="stylesheet">
<!-- Bootstrap CSS CDN -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/docs.css">
<link rel="stylesheet" href="css/learn.css">
<link rel="stylesheet" href="css/blog.css">
<link rel="stylesheet" href="css/guides.css">
<link rel="stylesheet" href="css/search.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/themes/prism.min.css">
</head>
<body data-spy="scroll" data-target="#toc">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KS8HHSF"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div class="main">
<!-- Bootstrap NavBar -->
<nav class="navbar navbar-expand-xl navbar-light cw-banner fixed-top" aria-label="topnav">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="/codewind/">
<img alt="Codewind logo image" title="Codewind logo image" src="images/header/header-logo.svg" class="cw-header-logo" alt="">
</a>
<div class="collapse navbar-collapse justify-content-end cw-navbar-padding" id="navbarNavDropdown">
<ul class="navbar-nav cw-navbar-nav">
<li class="nav-item cw-navbar-item cw-header-link-docs">
<a class="nav-link cw-nav-link cw-header-link-text" href="learn.html">Learn</a>
</li>
<li class="nav-item cw-navbar-item cw-header-link-news">
<a class="nav-link cw-nav-link cw-header-link-text" href="news.html">News</a>
</li>
<li class="nav-item cw-navbar-item cw-header-link-blog">
<a class="nav-link cw-nav-link cw-header-link-text" href="blog.html">Blog</a>
</li>
<li class="nav-item cw-navbar-item cw-header-link-guides">
<a class="nav-link cw-nav-link cw-header-link-text" href="guides.html">Guides</a>
</li>
<form class="form-inline my-2 my-lg-0 cw-navbar-item" action="/codewind/search.html" method="get">
<svg class="bi bi-search" width="1em" height="1em" viewBox="0 0 16 16" fill="black" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M10.442 10.442a1 1 0 011.415 0l3.85 3.85a1 1 0 01-1.414 1.415l-3.85-3.85a1 1 0 010-1.415z" clip-rule="evenodd"/>
<path fill-rule="evenodd" d="M6.5 12a5.5 5.5 0 100-11 5.5 5.5 0 000 11zM13 6.5a6.5 6.5 0 11-13 0 6.5 6.5 0 0113 0z" clip-rule="evenodd"/>
</svg>
<input id="nav-search" class="form-control mr-sm-2" type="text" id="search-box" name="query" placeholder="Search">
</form>
<li class="nav-item cw-navbar-item cw-header-link">
<a class="nav-link cw-nav-link" href="https://github.com/eclipse/codewind"><img alt="Codewind Github" class="banner-image" title="Codewind Github" data-toggle="tooltip" data-placement="top" id="cw_github_stars" title="..." src="images/header/github.svg"/></a>
</li>
<li class="nav-item cw-navbar-item cw-header-link">
<a class="nav-link cw-nav-link" href="https://twitter.com/EclipseCodewind"><img alt="Codewind Twitter" class="banner-image" title="Codewind Twitter" src="images/header/twitter.png"/></a>
</li>
<li class="nav-item cw-navbar-item cw-header-link">
<a class="nav-link cw-nav-link" href="https://mattermost.eclipse.org/eclipse/channels/eclipse-codewind"><img alt="Codewind Mattermost" class="banner-image" title="Codewind Mattermost" src="images/header/mattermost.png"/></a>
</li>
<li class="nav-item cw-navbar-item cw-header-link">
<a class="nav-link cw-nav-link" href="https://www.youtube.com/channel/UCnKCVK6RFDyHFqUmXlAhCHQ"><img alt="Codewind YouTube" class="banner-image" title="Codewind YouTube" src="images/header/youtube.png"/></a>
</li>
<!-- li class="nav-item cw-navbar-item" id="download-li">
<button onClick="window.location.href='https://microclimate.dev/download/codewind';" type="button" class="btn cw-download-button">Download</button>
<a href="https://microclimate.dev/download/codewind" class="nav-link cw-nav-link cw-download-link" href="#">Download</a>
</li> -->
<!-- Smaller devices menu END -->
</ul>
</div>
</nav>
<!-- End Bootstrap NavBar -->
<!-- Bootstrap row -->
<div class="row" id="body-row">
<div id="sidebar" class="bg-light">
<button class="btn btn-secondary dropdown-toggle btn-block d-md-none" type="button" id="contents-expander" data-toggle="collapse" aria-haspopup="true" aria-expanded="false" data-target="#sidebar-container">
Contents
</button>
<div id="sidebar-container" class="bg-light" role="navigation" aria-label="sidebar">
<!-- Bootstrap List Group -->
<ul class="list-group bg-light">
<!-- must be a valid css selector, or will break collapse function -->
<a href="#_getting_started" id="#_getting_started" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" aria-expanded="false">
<div class="d-flex align-items-center">
Getting started
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu collapse" id="_getting_started">
<a href="overview.html" class="bg-light list-group-item" data-parent="#_getting_started"
data-url="overview.html">What is Codewind?</a>
<a href="gettingstarted-overview.html" class="bg-light list-group-item" data-parent="#_getting_started"
data-url="gettingstarted-overview.html">Getting started - Overview</a>
<a href="#_vs_code" id="#_vs_code" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" data-parent="#_getting_started" aria-expanded="false">
<div class="d-flex align-items-center">
VS Code
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu-submenu collapse" id="_vs_code">
<a href="vsc-getting-started.html" class="bg-light list-group-item" data-parent="#_vs_code"
data-url="vsc-getting-started.html">1. Installing Codewind for VS Code</a>
<a href="vsc-firstproject.html" class="bg-light list-group-item" data-parent="#_vs_code"
data-url="vsc-firstproject.html">2. Creating your first Codewind project with Codewind for VS Code</a>
<a href="vsc-codechange.html" class="bg-light list-group-item" data-parent="#_vs_code"
data-url="vsc-codechange.html">3. Making a code change with VS Code</a>
<a href="vsc-uninstall.html" class="bg-light list-group-item" data-parent="#_vs_code"
data-url="vsc-uninstall.html">4. Uninstalling Codewind for VS Code</a>
</div>
<a href="#_eclipse" id="#_eclipse" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" data-parent="#_getting_started" aria-expanded="false">
<div class="d-flex align-items-center">
Eclipse
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu-submenu collapse" id="_eclipse">
<a href="eclipse-getting-started.html" class="bg-light list-group-item" data-parent="#_eclipse"
data-url="eclipse-getting-started.html">1. Installing Codewind for Eclipse</a>
<a href="eclipse-firstproject.html" class="bg-light list-group-item" data-parent="#_eclipse"
data-url="eclipse-firstproject.html">2. Creating your first Codewind project with Codewind for Eclipse</a>
<a href="eclipse-codechange.html" class="bg-light list-group-item" data-parent="#_eclipse"
data-url="eclipse-codechange.html">3. Making a code change with Eclipse</a>
<a href="eclipse-uninstall.html" class="bg-light list-group-item" data-parent="#_eclipse"
data-url="eclipse-uninstall.html">4. Uninstalling Codewind for Eclipse</a>
</div>
<a href="#_intellij" id="#_intellij" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" data-parent="#_getting_started" aria-expanded="false">
<div class="d-flex align-items-center">
IntelliJ
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu-submenu collapse" id="_intellij">
<a href="intellij-getting-started.html" class="bg-light list-group-item" data-parent="#_intellij"
data-url="intellij-getting-started.html">1. Installing Codewind for IntelliJ</a>
<a href="intellij-firstproject.html" class="bg-light list-group-item" data-parent="#_intellij"
data-url="intellij-firstproject.html">2. Creating your first Codewind project with Codewind for IntelliJ</a>
<a href="intellij-codechange.html" class="bg-light list-group-item" data-parent="#_intellij"
data-url="intellij-codechange.html">3. Making a code change with IntelliJ</a>
</div>
</div>
<a href="remote-deploying-codewind.html"
class="bg-light list-group-item list-group-item-action flex-column align-items-start"
data-url="remote-deploying-codewind.html">
Deploying Codewind remotely
</a>
<!-- must be a valid css selector, or will break collapse function -->
<a href="#_using_codewind_remotely" id="#_using_codewind_remotely" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" aria-expanded="false">
<div class="d-flex align-items-center">
Using Codewind remotely
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu collapse" id="_using_codewind_remotely">
<a href="remote-codewind-overview.html" class="bg-light list-group-item" data-parent="#_using_codewind_remotely"
data-url="remote-codewind-overview.html">1. Overview: Using Codewind remotely</a>
<a href="#_2_connecting_your_ide_to_remote_codewind" id="#_2_connecting_your_ide_to_remote_codewind" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" data-parent="#_using_codewind_remotely" aria-expanded="false">
<div class="d-flex align-items-center">
2. Connecting your IDE to remote Codewind
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu-submenu collapse" id="_2_connecting_your_ide_to_remote_codewind">
<a href="remotedeploy-vscode.html" class="bg-light list-group-item" data-parent="#_2_connecting_your_ide_to_remote_codewind"
data-url="remotedeploy-vscode.html">Connecting VS Code to remote Codewind</a>
<a href="remotedeploy-eclipse.html" class="bg-light list-group-item" data-parent="#_2_connecting_your_ide_to_remote_codewind"
data-url="remotedeploy-eclipse.html">Connecting Eclipse to remote Codewind</a>
</div>
<a href="remote-setupregistries.html" class="bg-light list-group-item" data-parent="#_using_codewind_remotely"
data-url="remote-setupregistries.html">3. Adding an image registry in remote Codewind</a>
<a href="#_4_creating_and_importing_projects" id="#_4_creating_and_importing_projects" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" data-parent="#_using_codewind_remotely" aria-expanded="false">
<div class="d-flex align-items-center">
4. Creating and importing projects
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu-submenu collapse" id="_4_creating_and_importing_projects">
<a href="remotedeploy-projects-vscode.html" class="bg-light list-group-item" data-parent="#_4_creating_and_importing_projects"
data-url="remotedeploy-projects-vscode.html">VS Code</a>
<a href="remotedeploy-projects-eclipse.html" class="bg-light list-group-item" data-parent="#_4_creating_and_importing_projects"
data-url="remotedeploy-projects-eclipse.html">Eclipse</a>
</div>
</div>
<!-- must be a valid css selector, or will break collapse function -->
<a href="#_using_codewind_on_eclipse_che" id="#_using_codewind_on_eclipse_che" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" aria-expanded="false">
<div class="d-flex align-items-center">
Using Codewind on Eclipse Che
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu collapse" id="_using_codewind_on_eclipse_che">
<a href="che-installinfo.html" class="bg-light list-group-item" data-parent="#_using_codewind_on_eclipse_che"
data-url="che-installinfo.html">1. Installing Eclipse Che for Codewind</a>
<a href="che-setupregistries.html" class="bg-light list-group-item" data-parent="#_using_codewind_on_eclipse_che"
data-url="che-setupregistries.html">2. Adding an image registry in Codewind on Eclipse Che</a>
<a href="che-createcodewindworkspace.html" class="bg-light list-group-item" data-parent="#_using_codewind_on_eclipse_che"
data-url="che-createcodewindworkspace.html">3. Creating a Codewind workspace in Eclipse Che</a>
<a href="che-createfirstproject.html" class="bg-light list-group-item" data-parent="#_using_codewind_on_eclipse_che"
data-url="che-createfirstproject.html">4. Creating your first Codewind project with Codewind for Eclipse Che</a>
<a href="che-codechange.html" class="bg-light list-group-item" data-parent="#_using_codewind_on_eclipse_che"
data-url="che-codechange.html">5. Making a code change with Codewind for Eclipse Che</a>
<a href="che-uninstall.html" class="bg-light list-group-item" data-parent="#_using_codewind_on_eclipse_che"
data-url="che-uninstall.html">6. Uninstalling Codewind for Eclipse Che</a>
</div>
<a href="che-odo-support.html"
class="bg-light list-group-item list-group-item-action flex-column align-items-start"
data-url="che-odo-support.html">
OpenShift Do (odo) support in Codewind
</a>
<a href="workingwithtemplates.html"
class="bg-light list-group-item list-group-item-action flex-column align-items-start"
data-url="workingwithtemplates.html">
Working with templates
</a>
<!-- must be a valid css selector, or will break collapse function -->
<a href="#_developing_projects" id="#_developing_projects" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" aria-expanded="false">
<div class="d-flex align-items-center">
Developing projects
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu collapse" id="_developing_projects">
<a href="checkingstatuses.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="checkingstatuses.html">Understanding application and build statuses</a>
<a href="importing-existing-projects.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="importing-existing-projects.html">Importing existing projects</a>
<a href="project-actions.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="project-actions.html">Project actions</a>
<a href="project-settings.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="project-settings.html">Project settings</a>
<a href="referencing-files.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="referencing-files.html">Referencing files external to a project</a>
<a href="openshiftregistry.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="openshiftregistry.html">Adding the OpenShift internal registry with Codewind</a>
<a href="private-registries.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="private-registries.html">Developing with packages from private registries and repositories</a>
<a href="linking-your-projects.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="linking-your-projects.html">Linking your projects</a>
<a href="offline-codewind.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="offline-codewind.html">Using Codewind offline</a>
<a href="debugging.html" class="bg-light list-group-item" data-parent="#_developing_projects"
data-url="debugging.html">Debugging in Codewind</a>
</div>
<!-- must be a valid css selector, or will break collapse function -->
<a href="#_performance_monitoring" id="#_performance_monitoring" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" aria-expanded="false">
<div class="d-flex align-items-center">
Performance monitoring
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu collapse" id="_performance_monitoring">
<a href="metrics-dashboard.html" class="bg-light list-group-item" data-parent="#_performance_monitoring"
data-url="metrics-dashboard.html">Understanding the Metrics Dashboard</a>
<a href="performance.html" class="bg-light list-group-item" data-parent="#_performance_monitoring"
data-url="performance.html">Monitoring applications with the Performance Dashboard</a>
</div>
<!-- must be a valid css selector, or will break collapse function -->
<a href="#_eclipse_codewind_tool_for_openapi" id="#_eclipse_codewind_tool_for_openapi" class="bg-light list-group-item list-group-item-action"
data-toggle="collapse" aria-expanded="false">
<div class="d-flex align-items-center">
Eclipse Codewind tool for OpenAPI
<span class="submenu-icon"></span>
</div>
</a>
<div class="cw-sidebar-div cw-sidebar-submenu collapse" id="_eclipse_codewind_tool_for_openapi">
<a href="open-api-tools-for-vscode.html" class="bg-light list-group-item" data-parent="#_eclipse_codewind_tool_for_openapi"
data-url="open-api-tools-for-vscode.html">Eclipse Codewind tool for OpenAPI in VS Code</a>
<a href="open-api-tools-for-eclipse.html" class="bg-light list-group-item" data-parent="#_eclipse_codewind_tool_for_openapi"
data-url="open-api-tools-for-eclipse.html">Eclipse Codewind tool for OpenAPI in Eclipse</a>
</div>
<a href="che-tektonpipelines.html"
class="bg-light list-group-item list-group-item-action flex-column align-items-start"
data-url="che-tektonpipelines.html">
Configuring Codewind for Tekton pipelines
</a>
<a href="troubleshooting.html"
class="bg-light list-group-item list-group-item-action flex-column align-items-start"
data-url="troubleshooting.html">
Troubleshooting
</a>
</ul>
<!-- List Group END-->
</div>
</div>
<!-- MAIN -->
<div id="content-container">
<div class="py-5 px-5">
<div role="main"><h1 id="importing-existing-projects">Importing existing projects</h1>
<p>Configure a project to run in Codewind.</p>
<h2 id="importing-projects-from-ides">Importing projects from IDEs</h2>
<p>Add a project from an existing Git repository:</p>
<ol>
<li>Clone the repository to your local computer.</li>
<li>Use the <strong>Add Existing Project</strong> command to add the project to Codewind.</li>
</ol>
<h2 id="requirements-for-importing-an-existing-project-not-created-in-codewind-or-through-appsody-or-odo">Requirements for importing an existing project not created in Codewind or through Appsody or Odo</h2>
<p>Local projects are built and run on Docker. To import your project to a local Codewind instance, you must include a Dockerfile. For more information about Dockerfiles, see <a href="https://docs.docker.com/engine/reference/builder/">Dockerfile documentation</a>. <strong>Note:</strong> The Dockerfile must contain an <code class="highlighter-rouge">EXPOSE</code> instruction to point to the port that the project runs on.</p>
<p>Remote projects are built and run on Kubernetes. To import your project to a remote Codewind instance, you must include a Dockerfile and a Helm chart. For more information about Dockerfiles and Helm charts, see <a href="https://docs.docker.com/engine/reference/builder/">Dockerfile documentation</a> and <a href="https://helm.sh/docs/topics/charts/">Helm chart documentation</a>.</p>
<p>To import your own project into Codewind, follow these same requirements. Make sure to select the <strong>Other (Basic Container)</strong> option as the project type.</p>
<h2 id="what-kind-of-projects-can-i-add">What kind of projects can I add?</h2>
<p>Codewind develops cloud-native microservices. Therefore, each project must be self-sufficient, not reliant on other projects to build. When using Codewind and determining the projects you want to develop, consider:</p>
<ul>
<li>To simplify enhancement in containers and deploy cloud-native applications, work with <a href="https://www.eclipse.org/codewind/overview.html">Codewind-style projects</a>.</li>
<li>To work with application stacks that deploy cloud applications to Kubernetes, work with <a href="https://appsody.dev/docs">Appsody-style projects</a>.</li>
<li>To deploy applications on an OpenShift or OKD cluster, work with <a href="https://www.eclipse.org/codewind/che-odo-support.html">OpenShift Do (odo)-style projects</a>.</li>
</ul>
<p>Codewind also contains a special build engine for the following languages. To utilize the build engine, see the following setup guides:</p>
<ul>
<li><a href="#microprofilejava-ee-projects">MicroProfile/Java EE projects</a></li>
<li><a href="#java-spring-projects">Java Spring projects</a></li>
<li><a href="#nodejs-projects">Node.js projects</a></li>
<li><a href="#swift-projects">Swift projects</a></li>
<li><a href="#appsody-projects">Appsody projects</a></li>
</ul>
<h2 id="microprofilejava-ee-projects">MicroProfile/Java EE projects</h2>
<p>MicroProfile projects are Java applications that are deployed to WebSphere Liberty. They are built by using Maven and the <code class="highlighter-rouge">liberty-maven-plugin</code> and are based on the <a href="https://hub.docker.com/_/websphere-liberty/">WebSphere Liberty Docker image</a>. MicroProfile projects support rapid iterative development in Codewind with a few changes to your <code class="highlighter-rouge">pom.xml</code> file.</p>
<h3 id="instructions">Instructions</h3>
<p>Avoid copying files from the project’s Maven target folder to any Dockerfile instructions because Codewind builds your project within the container. The application builds against the same runtime that is used in production to avoid inconsistencies between development and production environments.</p>
<h3 id="pre-import-instructions">Pre-import instructions</h3>
<p>MicroProfile projects must be configured to build by using Maven.</p>
<p><strong>Note:</strong> For an example of a working MicroProfile application, create a new MicroProfile project in Codewind. You can see the <code class="highlighter-rouge">pom.xml</code> file contents and use the file as a template when you configure your project’s <code class="highlighter-rouge">pom.xml</code> file.</p>
<p>Configure your <code class="highlighter-rouge">pom.xml</code> file as follows:</p>
<p>1. The Liberty Maven parent is required for rapid iterative development:</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;parent&gt;</span>
<span class="nt">&lt;groupId&gt;</span>net.wasdev.wlp.maven.parent<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>liberty-maven-app-parent<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>2.1.1<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;/parent&gt;</span>
</code></pre></div></div>
<p>2. Add a Maven profile for Codewind that configures the Liberty Maven plug-in.</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="nt">&lt;profile&gt;</span>
<span class="nt">&lt;id&gt;</span>microclimate<span class="nt">&lt;/id&gt;</span>
<span class="nt">&lt;activation&gt;</span>
<span class="nt">&lt;property&gt;</span>
<span class="nt">&lt;name&gt;</span>libertyEnv<span class="nt">&lt;/name&gt;</span>
<span class="nt">&lt;value&gt;</span>microclimate<span class="nt">&lt;/value&gt;</span>
<span class="nt">&lt;/property&gt;</span>
<span class="nt">&lt;/activation&gt;</span>
<span class="nt">&lt;build&gt;</span>
<span class="nt">&lt;directory&gt;</span>${microclimateOutputDir}<span class="nt">&lt;/directory&gt;</span>
<span class="nt">&lt;plugins&gt;</span>
<span class="c">&lt;!-- Enablement of liberty-maven plugin in Codewind --&gt;</span>
<span class="nt">&lt;plugin&gt;</span>
<span class="nt">&lt;groupId&gt;</span>net.wasdev.wlp.maven.plugins<span class="nt">&lt;/groupId&gt;</span>
<span class="nt">&lt;artifactId&gt;</span>liberty-maven-plugin<span class="nt">&lt;/artifactId&gt;</span>
<span class="nt">&lt;version&gt;</span>2.1.1<span class="nt">&lt;/version&gt;</span>
<span class="nt">&lt;extensions&gt;</span>true<span class="nt">&lt;/extensions&gt;</span>
<span class="nt">&lt;configuration&gt;</span>
<span class="nt">&lt;serverName&gt;</span>defaultServer<span class="nt">&lt;/serverName&gt;</span>
<span class="nt">&lt;looseApplication&gt;</span>true<span class="nt">&lt;/looseApplication&gt;</span>
<span class="nt">&lt;appsDirectory&gt;</span>apps<span class="nt">&lt;/appsDirectory&gt;</span>
<span class="nt">&lt;installDirectory&gt;</span>/opt/ibm/wlp<span class="nt">&lt;/installDirectory&gt;</span>
<span class="nt">&lt;userDirectory&gt;</span>${project.build.directory}/liberty/wlp/usr<span class="nt">&lt;/userDirectory&gt;</span>
<span class="nt">&lt;configFile&gt;</span>${basedir}/src/main/liberty/config/server.xml<span class="nt">&lt;/configFile&gt;</span>
<span class="nt">&lt;serverEnv&gt;</span>${basedir}/src/main/liberty/config/server.env<span class="nt">&lt;/serverEnv&gt;</span>
<span class="nt">&lt;jvmOptionsFile&gt;</span>${basedir}/src/main/liberty/config/jvm.options<span class="nt">&lt;/jvmOptionsFile&gt;</span>
<span class="nt">&lt;include&gt;</span>usr<span class="nt">&lt;/include&gt;</span>
<span class="nt">&lt;bootstrapProperties&gt;</span>
<span class="nt">&lt;default.http.port&gt;</span>9080<span class="nt">&lt;/default.http.port&gt;</span>
<span class="nt">&lt;default.https.port&gt;</span>9443<span class="nt">&lt;/default.https.port&gt;</span>
<span class="nt">&lt;/bootstrapProperties&gt;</span>
<span class="nt">&lt;installAppPackages&gt;</span>project<span class="nt">&lt;/installAppPackages&gt;</span>
<span class="nt">&lt;/configuration&gt;</span>
<span class="nt">&lt;/plugin&gt;</span>
<span class="nt">&lt;/plugins&gt;</span>
<span class="nt">&lt;/build&gt;</span>
<span class="nt">&lt;/profile&gt;</span>
</code></pre></div></div>
<p>3. Add the required Liberty Maven plug-in configuration:</p>
<ul>
<li>
<p>Add the <code class="highlighter-rouge">server.xml</code> Liberty server configuration file located in the source folder that is referenced in the <code class="highlighter-rouge">pom.xml</code> file.</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;configFile&gt;</span>${basedir}/src/main/liberty/config/server.xml<span class="nt">&lt;/configFile&gt;</span>
</code></pre></div> </div>
</li>
<li>
<p>Optional: Add the Liberty server environment file:</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;serverEnv&gt;</span>${basedir}/src/main/liberty/config/server.env<span class="nt">&lt;/serverEnv&gt;</span>
</code></pre></div> </div>
</li>
<li>
<p>Optional: Add the Liberty Java Virtual Machine options file:</p>
<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code>(jvm.options)
<span class="nt">&lt;jvmOptionsFile&gt;</span>${basedir}/src/main/liberty/config/jvm.options<span class="nt">&lt;/jvmOptionsFile&gt;</span>
</code></pre></div> </div>
</li>
<li>
<p>Add <code class="highlighter-rouge">/mc-target</code> to the <code class="highlighter-rouge">.gitignore</code> file to ignore build output from the <code class="highlighter-rouge">microclimate</code> build profile.</p>
</li>
</ul>
<p><strong>Note:</strong> Due to a known issue, the server needs to be configured to use port 9080 in order for the project to be detected as <code class="highlighter-rouge">started</code>. See <a href="troubleshooting.html">Troubleshooting</a> for more details.</p>
<h3 id="post-import-instructions">Post-import instructions</h3>
<p>The following files are generated during the import process. If your project requires additional configuration files or instructions for build, you might need to modify them.</p>
<p><strong>Note:</strong> Only MicroProfile projects enable the use of <code class="highlighter-rouge">Dockerfile-lang</code> and <code class="highlighter-rouge">Dockerfile-build</code> files.</p>
<p><strong>Dockerfile-lang</strong></p>
<p>The <code class="highlighter-rouge">Dockerfile-lang</code> file is an optional project file and a development version of the Dockerfile. It contains any Docker instructions that are required only for the development image, including copying application resources from source. For example, if your application requires configuration files, you can use a <code class="highlighter-rouge">COPY</code> instruction to copy those files into your application’s Docker container.</p>
<p>If <code class="highlighter-rouge">Dockerfile-lang</code> does not exist, the Dockerfile is used for the development image instead.</p>
<p>Maven is included in a generated <code class="highlighter-rouge">Dockerfile-build</code> file, so you do not need to include instructions to set up a Maven download in <code class="highlighter-rouge">Dockerfile-lang</code>.</p>
<p><strong>Dockerfile-build</strong></p>
<p>The <code class="highlighter-rouge">Dockerfile-build</code> file is used to install a Java SDK and Maven. This file must be updated if your application requires different versions of these tools.</p>
<h2 id="java-spring-projects">Java Spring projects</h2>
<p>Java Spring Boot projects are built by using Maven and produce stand-alone runnable applications.</p>
<p>Requirements:</p>
<ul>
<li>The project must be a valid Spring Boot project. The <code class="highlighter-rouge">pom.xml</code> must contain a dependency on an artifact from the <code class="highlighter-rouge">&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; group</code>.</li>
<li>The <code class="highlighter-rouge">artifactId</code> value in the <code class="highlighter-rouge">pom.xml</code> file must match the project name.</li>
<li>Configure the project to build with Maven and produce a exectutable <code class="highlighter-rouge">.jar</code> file.</li>
<li>Configure the application to use port 8080.</li>
<li>Copy the executable <code class="highlighter-rouge">.jar</code> file produced by the Maven build to <code class="highlighter-rouge">/app.jar</code> within the Docker container. To do this, simply add a <code class="highlighter-rouge">COPY</code> instruction to the Dockerfile.</li>
</ul>
<p>Example:</p>
<div class="language-docker highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">FROM</span><span class="s"> ibmjava:8-sfj</span>
MAINTAINER IBM Java engineering at IBM Cloud
COPY target/spring-application-2.0.0.BUILD-SNAPSHOT.jar /app.jar
ENV JAVA_OPTS=""
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
</code></pre></div></div>
<h2 id="nodejs-projects">Node.js projects</h2>
<p>Your <code class="highlighter-rouge">package.json</code> must meet the following requirements. For an example of a good <code class="highlighter-rouge">package.json</code> for importing, see <a href="https://github.com/ibm-developer/generator-ibm-core-node-express/blob/develop/app/templates/package.json">the express application generator</a>:</p>
<ul>
<li>Ensure the project provides a <code class="highlighter-rouge">start</code> npm script in <code class="highlighter-rouge">package.json</code>, so it can be started by <code class="highlighter-rouge">npm start</code>.
<ul>
<li>For example: <code class="highlighter-rouge">start: "node server/server.js"</code>.</li>
</ul>
</li>
<li>In local installations of Codewind, you can restart the project in Debug mode. To use this feature, the project must also provide a <code class="highlighter-rouge">debug</code> npm script that accepts connections from all hosts on port 9229. For help configuring this script, see <a href="https://nodejs.org/en/docs/guides/debugging-getting-started/#command-line-options">the Node.js debugging guide</a>.
<ul>
<li>For example: <code class="highlighter-rouge">debug: "node --inspect=0.0.0.0:9229 server/server.js"</code></li>
</ul>
</li>
<li>If auto-build is enabled, <code class="highlighter-rouge">nodemon</code> is used to restart your project automatically. <code class="highlighter-rouge">nodemon</code> calls either the <code class="highlighter-rouge">start</code> or <code class="highlighter-rouge">debug</code> script on a code change, depending on whether or not the project is debugging. Consequently, neither of these scripts should invoke <code class="highlighter-rouge">nodemon</code>.
<ul>
<li>If a problem occurs with either script, the error appears in the Application Logs view in Codewind.</li>
</ul>
</li>
</ul>
<p>If you have a <code class="highlighter-rouge">Dockerfile</code>, it must meet the following requirements:</p>
<ul>
<li>Ensure the <code class="highlighter-rouge">Dockerfile</code> exposes your application port.
<ul>
<li>For example, if you’re using port 3000, the <code class="highlighter-rouge">Dockerfile</code> needs to include <code class="highlighter-rouge">EXPOSE 3000</code>.</li>
</ul>
</li>
<li>Ensure that the application is located in the <code class="highlighter-rouge">/app</code> directory within the Docker container.</li>
<li>Ensure that the <code class="highlighter-rouge">Dockerfile</code> sets the working directory to <code class="highlighter-rouge">/app</code> with <code class="highlighter-rouge">WORKDIR "/app"</code>.</li>
<li>For more information about Dockerfiles, see <a href="https://docs.docker.com/engine/reference/builder/">Dockerfile reference</a>.</li>
</ul>
<h2 id="swift-projects">Swift projects</h2>
<p>Codewind works with Swift projects that use the Kitura web framework.</p>
<p>Requirements:</p>
<ul>
<li>Ensure the project can be built by using a <code class="highlighter-rouge">release</code> build configuration.</li>
</ul>
<p>For example, you can build the project by using the command: <code class="highlighter-rouge">swift build --configuration release</code>.</p>
<h2 id="appsody-projects">Appsody projects</h2>
<p>If you have an existing Appsody project or a project that you want to add to Codewind as an Appsody project, select the corresponding Appsody project type and, if applicable, the Appsody stack when adding the project.
For more information about Appsody and Appsody stacks, see <a href="https://appsody.dev">https://appsody.dev</a>.</p>
<h4 id="defining-environment-variables-for-appsody-projects">Defining environment variables for Appsody projects</h4>
<p>Complete the following steps to define environment variables that take effect in an Appsody application:</p>
<ol>
<li>Create an <code class="highlighter-rouge">env.properties</code> file in the root of the Appsody project.
<ul>
<li><strong>Caution:</strong> Do not commit the <code class="highlighter-rouge">env.properties</code> file to your source repository if it contains confidential information, such as passwords. To avoid including sensitive information in your project, you can include the <code class="highlighter-rouge">env.properties</code> file as a reference, for more information, see <a href="referencing-files.html">Referencing files external to a project</a>.</li>
</ul>
</li>
<li>Define your environment variables in this file by using the standard properties format. This format features one <code class="highlighter-rouge">name=value</code> entry per line.
<ul>
<li>One of the environment variables you can set is <code class="highlighter-rouge">CW_NETWORKS</code>, a space delimited list of docker networks the Appsody application can join.</li>
</ul>
</li>
<li>If autobuild is enabled, Codewind automatically rebuilds the project to pick up the environment values. If autobuild is not enabled, new values take effect the next time you rebuild the project.</li>
</ol>
</div>
</div>
<div class="py-5 px-5 text-right">
Last update: Jun 29, 2020
</div>
</div>
</div>
<!-- footer row -->
<footer>
<div id="footer-div-mobile">
<div class="row">
<div class="col-sm-12 text-center">
<span>Useful Links:</span>
<br/><br/>
<a class="cw-footer-links" href="http://www.eclipse.org">Eclipse Foundation</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/termsofuse.php">Website Terms of Use</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal">Legal</a><br/>
</div>
</div>
<div class="cw_footer_display_flex cw-footer-same-height cw-footer-center">
<div class="cw_footer_display_icons row">
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="mailto:codewind-dev@eclipse.org"><img alt="Send us an email" title="Send us an email" src="images/footer/email-icon.svg" class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="https://twitter.com/EclipseCodewind"><img alt="Codewind Twitter" title="Codewind Twitter" src="images/footer/twitter-logo.svg" class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="https://github.com/eclipse/codewind"><img alt="Codewind Github" title="Codewind Github" src="images/footer/github-logo.svg"
class="cw-logo" /></a>
</div>
</div>
</div>
<div class=" cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="https://mattermost.eclipse.org/eclipse/channels/eclipse-codewind"><img alt="Codewind Mattermost" title="Codewind Mattermost" src="images/footer/mattermost-logo.png" class="cw-logo-mm" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="https://www.youtube.com/channel/UCnKCVK6RFDyHFqUmXlAhCHQ"><img alt="Codewind YouTube" title="Codewind YouTube" src="images/footer/youtube-logo-dark.svg"
class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="http://www.eclipse.org"><img class="cw-logo-eclipse-mobile" alt="Eclipse" title="Eclipse" src="images/footer/eclipse.svg"/></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row cw-footer-desktop" id="footer-div">
<div class="cw-footer-left">
<div class="px-5 cw-font-12>
<span class="cw-font-14">Useful Links:</span>
<br/><br/>
<a class="cw-footer-links" href="http://www.eclipse.org">Eclipse Foundation</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/termsofuse.php">Website Terms of Use</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal">Legal</a><br/>
</div>
</div>
<div class="cw-footer-border-right"></div>
<div class="cw_footer_display_flex cw-footer-same-height cw-footer-center">
<div class="cw_footer_display_icons">
<div class="cw-footer-col text-center">
<div>
<div>
<a href="mailto:codewind-dev@eclipse.org"><img alt="Send us an email" title="Send us an email" src="images/footer/email-icon.svg" class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center">
<div>
<div>
<a href="https://twitter.com/EclipseCodewind"><img alt="Codewind Twitter" title="Codewind Twitter" src="images/footer/twitter-logo.svg" class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center">
<div>
<div>
<a href="https://github.com/eclipse/codewind"><img alt="Codewind Github" title="Codewind Github" src="images/footer/github-logo.svg"
class="cw-logo" /></a>
</div>
</div>
</div>
<div class=" cw-footer-col text-center">
<div class="cw-logo-mm" >
<div class="cw-logo-mm" >
<a href="https://mattermost.eclipse.org/eclipse/channels/eclipse-codewind"><img alt="Codewind Mattermost" title="Codewind Mattermost" src="images/footer/mattermost-logo.png" class="cw-logo-mm" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center">
<div>
<div>
<a href="https://www.youtube.com/channel/UCnKCVK6RFDyHFqUmXlAhCHQ"><img alt="Codewind YouTube" title="Codewind YouTube" src="images/footer/youtube-logo-dark.svg"
class="cw-logo" /></a>
</div>
</div>
</div>
</div>
</div>
<div class="cw-footer-border-right"></div>
<div class="cw-footer-right cw-footer-same-height cw-footer-vcenter">
<div class="cw-footer-eclipse-img cw-footer-same-height px-5 ">
<a href="http://www.eclipse.org">
<img alt="Eclipse" title="Eclipse" src="images/footer/eclipse.svg"/>
</a>
</div>
</div>
</div>
</footer>
<!-- footer row END -->
<!-- Main Col END -->
<!-- Jquery -->
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>
<!-- Font Awesome JS -->
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/solid.js"
integrity="sha384-tzzSw1/Vo+0N5UhStP3bvwWPq+uvzCMfrN1fEFe+xBmv1C/AtVX5K0uZtmcHitFZ" crossorigin="anonymous">
</script>
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/fontawesome.js"
integrity="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin="anonymous">
</script>
<script src="js/jquery.matchHeight-min.js"></script>
<script src="js/index.js"></script>
<script src="js/docs.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-docker.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-json.min.js"></script>
</div>
</body>
</html>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.0/anchor.min.js"></script>
<script>
$(document).ready(function () {
anchors.options.placement = 'left';
anchors.add('h1');
anchors.add('h2');
anchors.add('h3');
anchors.add('h4');
});
</script>