# This is a sample build configuration for Java (Maven).
# Check our guides at https://confluence.atlassian.com/x/zd-5Mw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: maven:3.6.0
pipelines:
default:
- step:
name: Clean Build
caches:
- maven
script: # Modify the commands below to build your repository.
- mvn -B clean # -B batch mode makes Maven less verbose
- step:
name: Compile build
caches:
- maven
script: # Modify the commands below to build your repository.
- mvn -B compile # -B batch mode makes Maven less verbose
- step:
name: Package build
caches:
- maven
script: # Modify the commands below to build your repository.
- mvn -B package # -B batch mode makes Maven less verbose
artifacts:
- target/**
- step:
name: Deployment
deployment: test
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.3
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: $APPLICATION_NAME
ENVIRONMENT_NAME: $ENVIRONMENT_NAME
S3_BUCKET: $S3_BUCKET
ZIP_FILE: 'target/ezstore-1.0.jar'
above is my pipeline, when it run, i can see from build set up,cache is extractedCache "maven": Downloading
Cache
"maven": Downloaded 1.7 MiB in 2 secondsCache
"maven": ExtractingCache
"maven": Extracted in 0 seconds
However, I can still see cache is not use and it keep download from maven central
[INFO] Scanning for projects...[INFO] [INFO] --------------------------< edu.mum:ezstore >---------------------------
[INFO] Building EZStore API 1.0[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.1.0/maven-resources-plugin-3.1.0.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.1.0/maven-resources-plugin-3.1.0.pom (7.2 kB at 34 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/3.1.0/maven-resources-plugin-3.1.0.jar
Please let me know what is wrong with it
Some problem with the cache as it is not updated and stuck in 1.77mb, I deleted the cache and run again the cache went up to 70+mb. now cache is loaded
Hi @cdov ,
Please try using one step
mvn -B clean package
package
will compile your code and also package it. For example, if your pom says the project is a jar, it will create a jar for you when you package it and put it somewhere in the target directory (by default).
One step for build and one for deployment.
- step:
name: Clean / Package Build
caches:
- maven
script:
- mvn -B clean package
- step:
name: Deployment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
image: maven:3.6.0
pipelines:
default:
- step:
name: Clean and Package build
caches:
- maven
script: # Modify the commands below to build your repository.
- mvn -B clean package # -B batch mode makes Maven less verbose
artifacts:
- target/**
- step:
name: Deployment
deployment: test
script:
- pipe: atlassian/aws-elasticbeanstalk-deploy:0.2.3
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
APPLICATION_NAME: $APPLICATION_NAME
ENVIRONMENT_NAME: $ENVIRONMENT_NAME
S3_BUCKET: $S3_BUCKET
ZIP_FILE: 'target/ezstore-1.0.jar'
here is updated pipeline
still it is downloading the cache, even I did run it twice
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please try moving caches as your first step.
Do you see caches as shown? Have you had a successful build?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.