Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ In this lab you will create a console application using the Microsoft Authentica

- [Java Microsoft Graph tutorial](https://docs.microsoft.com/graph/tutorials/java)

## Demos

The [demos](./demos) directory in this repository contains copies of the project that correspond to completing individual sections of the tutorial. If you just want to demo a particular section of the tutorial, you can start with the version from the previous section.

- [01-create-app](demos/01-create-app): Completed [Create a Java console app](https://docs.microsoft.com/graph/tutorials/java?tutorial-step=1)
- [02-add-aad-auth](demos/02-add-aad-auth): Completed [Add Azure AD authentication](https://docs.microsoft.com/graph/tutorials/java?tutorial-step=3)
- [03-add-msgraph](demos/03-add-msgraph): Completed [Get calendar data](https://docs.microsoft.com/graph/tutorials/java?tutorial-step=4)

## Completed sample

If you just want the completed sample generated by following this lab, you can find it here.

- [Completed project](demos/03-add-msgraph)
- [Completed project](demo)

## Disclaimer

Expand Down
5 changes: 2 additions & 3 deletions demos/03-add-msgraph/README.md → demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

To run the completed project in this folder, you need the following:

- [Java SE Development Kit (JDK)](https://java.com/en/download/faq/develop.xml) and [Maven](https://maven.apache.org/) installed on your development machine. If you do not have the JDK or Maven, visit the previous links for download options. (**Note:** This tutorial was written with OpenJDK version 12.0.1 and Maven 3.6.1. The steps in this guide may work with other versions, but that has not been tested.)
- [Java SE Development Kit (JDK)](https://java.com/en/download/faq/develop.xml) and [Gradle](https://gradle.org/) installed on your development machine. If you do not have the JDK or Gradle, visit the previous links for download options. (**Note:** This tutorial was written with OpenJDK version 14.0.0.36 and Gradle 6.3. The steps in this guide may work with other versions, but that has not been tested.)
- A Microsoft work or school account.

If you don't have a Microsoft account, you can [sign up for the Office 365 Developer Program](https://developer.microsoft.com/office/dev-program) to get a free Office 365 subscription.
Expand Down Expand Up @@ -48,6 +48,5 @@ If you don't have a Microsoft account, you can [sign up for the Office 365 Devel
In your command-line interface (CLI), navigate to the project directory and run the following commands.

```Shell
mvn package
java -cp target/graphtutorial-1.0-SNAPSHOT.jar com.contoso.App
./gradlew --console plain run
```
6 changes: 6 additions & 0 deletions demo/graphtutorial/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

5 changes: 5 additions & 0 deletions demo/graphtutorial/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
17 changes: 17 additions & 0 deletions demo/graphtutorial/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>graphtutorial_</name>
<comment>Project graphtutorial_ created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions demo/graphtutorial/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1
45 changes: 45 additions & 0 deletions demo/graphtutorial/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.3/userguide/tutorial_java_projects.html
*/

plugins {
// Apply the java plugin to add support for Java
id 'java'

// Apply the application plugin to add support for building a CLI application.
id 'application'
}

repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}

// <DependenciesSnippet>
dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:28.2-jre'

// Use JUnit test framework
testImplementation 'junit:junit:4.12'
implementation 'com.microsoft.azure:msal4j:1.4.0'
implementation 'com.microsoft.graph:microsoft-graph:1.6.0'
implementation 'org.slf4j:slf4j-nop:1.8.0-beta4'
}
// </DependenciesSnippet>

application {
// Define the main class for the application.
mainClassName = 'graphtutorial.App'
}

// <StandardInputSnippet>
run {
standardInput = System.in
}
// </StandardInputSnippet>
Binary file not shown.
5 changes: 5 additions & 0 deletions demo/graphtutorial/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
183 changes: 183 additions & 0 deletions demo/graphtutorial/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading