Skip to content

Java Maven sample#7

Open
AmodhShenoy wants to merge 14 commits intodlcbld:mainfrom
AmodhShenoy:maven-sample
Open

Java Maven sample#7
AmodhShenoy wants to merge 14 commits intodlcbld:mainfrom
AmodhShenoy:maven-sample

Conversation

@AmodhShenoy
Copy link
Copy Markdown

No description provided.

1. Install Java SE SDK 11 on your system: https://java.com/en/download/help/download_options.html
2. Compile the app:

```javac src/com/sample/HelloWorld.java```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it says maven example but why are we using javac to build the code. i would expect to use 'mvn clean install' command here.

timeoutInSeconds: 10000
command: |
cd src/com/sample/
javac HelloWorld.java
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be using mvn rather than java here.

FROM openjdk:8-alpine
COPY ./src/com/sample/HelloWorld.class /app/com/sample/HelloWorld.class
WORKDIR /app
ENTRYPOINT ["java", "com.sample.HelloWorld"] No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker file also should change for maven.

runAs: root
- type: Command
name: "Building JAR"
timeoutInSeconds: 10000
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are doing mvn here. then ideally we should be removing the other build spec file.

command: |
mvn clean install
onFailure:
- type: Command
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should also do a docker build here to have a complete example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants