# Okta Spring Boot - compile error

**URL:** <https://devforum.okta.com/t/okta-spring-boot-compile-error/17814>\
**Category:** Questions\
**Created:** [November 2, 2021, 7:06pm UTC](https://devforum.okta.com/t/okta-spring-boot-compile-error/17814 "2021-11-02T19:06:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![spuds23](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@spuds23](https://devforum.okta.com/u/spuds23)\
**Post date:** [November 2, 2021, 7:06pm UTC](https://devforum.okta.com/t/okta-spring-boot-compile-error/17814/1 "2021-11-02T19:06:19Z")

</div>

Hi,

I am attempting to build your okta java spring app using the following cmd (from github sample doc),

```nohighlight
xyz:~/environment/samples-java-spring/custom-login (master) $ mvn -Dokta.oauth2.issuer=https://dev-xyz.okta.com/oauth2/default -Dokta.oauth2.clientId=xyz -Dokta.oauth2.clientSecret=xyz
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.example.okta:okta-spring-boot-oauth-code-flow-custom-login-example:jar:0.0.1-SNAPSHOT
[WARNING] 'parent.relativePath' of POM com.example.okta:okta-spring-boot-oauth-code-flow-custom-login-example:0.0.1-SNAPSHOT (/home/ec2-user/environment/samples-java-spring/custom-login/pom.xml) points at com.okta.examples:aggregator instead of org.springframework.boot:spring-boot-starter-parent, please verify your project structure @ line 20, column 13
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building Okta :: Samples :: Spring Boot :: Code Flow + Custom Login Page 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> spring-boot-maven-plugin:2.5.2:run (default-cli) > test-compile @ okta-spring-boot-oauth-code-flow-custom-login-example >>>
[INFO] 
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ okta-spring-boot-oauth-code-flow-custom-login-example ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 7 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ okta-spring-boot-oauth-code-flow-custom-login-example ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /home/ec2-user/environment/samples-java-spring/custom-login/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.060 s
[INFO] Finished at: 2021-11-02T18:55:48Z
[INFO] Final Memory: 18M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project okta-spring-boot-oauth-code-flow-custom-login-example: Fatal error compiling: invalid flag: -parameters -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
bosox23:~/environment/samples-java-spring/custom-login (master) $ 

```

Param error(s) on cmd line (xyz is just for this post so that’s not RC). POM or source need updates to handle these cmd line params? User error? NOTE: I have to install maven on local dev box (step missing from sample).

See this in local POM,

```xml
 18 <modelVersion>4.0.0</modelVersion>
 19 
 20 <parent>
 21 <groupId>org.springframework.boot</groupId>
 22 <artifactId>spring-boot-starter-parent</artifactId>
 23 <version>2.5.2</version>
 24 </parent>
 25 
 26 <groupId>com.example.okta</groupId>
 27 <artifactId>okta-spring-boot-oauth-code-flow-custom-login-example</artifactId>
 28 <version>0.0.1-SNAPSHOT</version>
 29 <packaging>jar</packaging>
 30 
 31 <name>Okta :: Samples :: Spring Boot :: Code Flow + Custom Login Page</name>
 32 <description>Okta OAuth 2.0 w/ Spring Boot Example + Custom Login Page</description>
 33 
 34 <properties>
 35 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 36 <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 37 <java.version>1.8</java.version>

```

Thank you.

---

<div class="post-metadata">

**Author:** ![tyty](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tyty](https://devforum.okta.com/u/tyty)\
**Post date:** [November 2, 2021, 7:26pm UTC](https://devforum.okta.com/t/okta-spring-boot-compile-error/17814/2 "2021-11-02T19:26:05Z")

</div>

Hey there! I assume you are referring to the following? [GitHub - okta-samples/okta-spring-boot-sample: Spring Boot + Okta](https://github.com/okta-samples/okta-spring-boot-sample)

---

<div class="post-metadata">

**Author:** ![spuds23](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@spuds23](https://devforum.okta.com/u/spuds23)\
**Post date:** [November 2, 2021, 8:24pm UTC](https://devforum.okta.com/t/okta-spring-boot-compile-error/17814/3 "2021-11-02T20:24:58Z")

</div>

Yes that is correct …

---

<div class="post-metadata">

**Author:** ![tyty](https://avatars.discourse-cdn.com/v4/letter/t/35a633/32.png) [@tyty](https://devforum.okta.com/u/tyty)\
**Post date:** [November 3, 2021, 2:42pm UTC](https://devforum.okta.com/t/okta-spring-boot-compile-error/17814/4 "2021-11-03T14:42:31Z")

</div>

Interesting, I am not able to reproduce the error on my end. Do you see the same issue when you configure and build this sample? You’re looking for a custom self-hosted login implementation rather than okta-hosted (redirect to okta), correct?

> **[samples-java-spring/custom-login at master · okta/samples-java-spring](https://github.com/okta/samples-java-spring/tree/master/custom-login)**
>
> master/custom-login

---

<div class="post-metadata">

**Author:** ![bdemers](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/bdemers/32/23_2.png) [@bdemers](https://devforum.okta.com/u/bdemers)\
**Post date:** [November 9, 2021, 3:08pm UTC](https://devforum.okta.com/t/okta-spring-boot-compile-error/17814/5 "2021-11-09T15:08:43Z")

</div>

You can safely ignore the warning, that Spring Boot parent pom would be downloaded from Maven Central.

The compile error looks real, but I’m guessing that has more to do with the version of Java you are using.

Which version are you using? I quickly just tried (without issue):

- 11.0.11.9.1-amzn
- 8.292.10.1-amzn
- 17.0.1.12.1-amzn

Anything Java 8+ should work.

Keep us posted!

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 10, 2024, 1:07am UTC](https://devforum.okta.com/t/okta-spring-boot-compile-error/17814/6 "2024-02-10T01:07:17Z")

</div>


