Skip to content

Get Started with Skeleton Project

MsaasAPI edited this page Oct 15, 2018 · 10 revisions

📑For those interested in API or SB sample apps, skip this wiki page📑
📑This article is stand-alone, and not particularly associated with other wiki pages📑

CONTENTS

PREREQUISITE

  1. Click Explorer icon on activity bar.

  2. Open a folder by either a. clicking Open Folder button, b. hotkey Ctrl K + Ctrl O, or c. File > Open Folder….

  3. Select target folder on File Explorer, and click Select Folder button.

📑Earlier version might have Integrated Terminal instead of Terminal selection📑

  1. Toggle open the Integrated Terminal by either a. clicking View > Terminal or b. hotkey Ctrl `.

  2. The Integrated Terminal shall appear at the bottom right corner. Note that there are several shells available: Windows Command Line, PowerShell, Bash, and Git Bash, which may be specified in User Settings.

  3. Run the following command based on the prescribed template to create a new Maven console project. For other type of projects, see Maven Archetype page for alternative DarchetypeArtifcactId values.

    mvn archetype:generate -DgroupId=com.yourcompanyname.yourappname -DartifactId=yourappname -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
    
  4. The skeleton project build process may take up to minutes, if it is first ever Maven build on the machine. A successful build will be returned with the following message.

  1. Switch folder by opening folder to the folder of the new project.

  2. As soon as the folder is opened, the project will undergo initialization process. After completion, the side bar shall looks something like this.

  3. Create tasks.json - Open Command Palette by either a. hotkey F1, b. hotkey Ctrl + Shift P, or c. View > Command Palette….

  4. The following popup palette will appear at top center of VS Code window.

  5. Type the following command, and press Enter key.

    Tasks: Configure Task
    

📑Common follow-up command(s) may pop up and available for selection📑

  1. Then type the following command, and press Enter key.

    Create tasks.json file from template
    

  2. Then type the following command, and press Enter key.

    maven Executes common maven commands
    

  3. The file tasks.json is created at once.

  4. Add the following new item to tasks.json array, and save file.

    {
      "label": "compile",
      "type": "shell",
      "command": "mvn -B compile",
      "group": "build"
    },
    

  5. Click pom.xml on the side bar.

  6. Add the following attribute to avoid mvn compilation error and enable newer Java framework features, such as lambda expression.

    <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    

  7. optional If your JRE version is newer, consider setting to higher Java Compiler Compliance level than 1.8 to avoid compilation warning like The compiler compliance for JRE 10 is used, although it is optional.

    <properties>
    <maven.compiler.source>9</maven.compiler.source>
    <maven.compiler.target>9</maven.compiler.target>
    </properties>
    
    <properties>
    <maven.compiler.source>10</maven.compiler.source>
    <maven.compiler.target>10</maven.compiler.target>
    </properties>
    
  8. Compile - Again, open Command Palette, type the following command, and hit Enter key.

    Tasks: Run Build Task
    

  9. Then type the following command, and press Enter key.

    Compile
    

  10. Then type the following command, and press Enter key.

    Continue without scanning the task output
    

  11. On the pop-up Integrated Terminal, verify the build is successful.

  12. Press F5 key to launch the debugger. During the first-time launch, select Java for the following pop-up query.

  13. Verify the Hello World! message appears on the Debug Console.

  14. optional When launching console application in debug mode, there are three console options 1. internalConsole, 2. integratedTerminal, or 3. externalTerminal. This can be configured in launch.json. As seen below, there are two debug launch modes, each with its own console option. For consistency, consider assign same option for both launch modes.

    • Internal Console:
    • Integrated Terminal:
    • External Terminal:

C#

Visual Studio

  • Get Started

VS Code

  • Get Started

JAVA

VS Code

NODEJS

VS Code

POSTMAN

REFERENCES

Clone this wiki locally