CleverCloud / generator-jhipster-clevercloud

💡☁ JHipster module, additional Clever Cloud support in your JHipster application
Apache License 2.0
0 stars 2 forks source link

The given jarName does not exist #4

Open agoncal opened 6 years ago

agoncal commented 6 years ago

I've done all the steps (installation, answering the questions, ...) but when I execute clever deploy I get the error "Error: The given jarName (sponsor-0.0.1-SNAPSHOT.war) does not exist". Under the clevercloud directory the generator has created :

clevercloud/
├── application-clevercloud.yml
└── maven.json

The maven.json file looks like this:

{
  "build": {
    "type": "maven",
    "goal": "-Pprod package -DskipTests"
  },
  "deploy": {
    "jarName": "./target/sponsor-0.0.1-SNAPSHOT.war"
  }
}

And if I ls my target directory I do have the war file:

$ ll target/
 sponsor-0.0.1-SNAPSHOT.war
 sponsor-0.0.1-SNAPSHOT.war.original

The full error:

$ clever deploy
Pushing source code to Clever Cloud.
Your source code has been pushed to Clever Cloud.
Waiting for application logs…
Deployment started
2017-11-16T16:58:23.745Z: (CRON) INFO (RANDOM_DELAY will be scaled with factor 69% if used.)
2017-11-16T16:58:23.745Z: (CRON) INFO (running with inotify support)
2017-11-16T16:58:23.754Z: Setting up system
2017-11-16T16:58:23.756Z: Starting application
2017-11-16T16:58:23.756Z: Created symlink /etc/systemd/system/multi-user.target.wants/rsyslog.service → /usr/x86_64-pc-linux-gnu/lib/systemd/system/rsyslog.service.
2017-11-16T16:58:23.757Z: Inject POSTGRESQL_ADDON_USER
2017-11-16T16:58:23.757Z: Inject INSTANCE_NUMBER
2017-11-16T16:58:23.757Z: Inject CC_DEPLOYMENT_ID
2017-11-16T16:58:23.757Z: Inject POSTGRESQL_ADDON_HOST
2017-11-16T16:58:23.757Z: Inject POSTGRESQL_ADDON_DB
2017-11-16T16:58:23.757Z: Inject PORT
2017-11-16T16:58:23.757Z: Inject CC_PRE_RUN_HOOK
2017-11-16T16:58:23.758Z: Inject POSTGRESQL_ADDON_URI
2017-11-16T16:58:23.758Z: Inject CC_ENVIRON_UPDATE_TOKEN
2017-11-16T16:58:23.758Z: Inject POSTGRESQL_ADDON_PASSWORD
2017-11-16T16:58:23.758Z: Inject CC_REVERSE_PROXY_IPS
2017-11-16T16:58:23.758Z: Inject CC_ENVIRON_UPDATE_URL
2017-11-16T16:58:23.758Z: Inject JAVA_VERSION
2017-11-16T16:58:23.759Z: Inject POSTGRESQL_ADDON_PORT
2017-11-16T16:58:23.759Z: Inject INSTANCE_TYPE
2017-11-16T16:58:23.759Z: Inject INSTANCE_ID
2017-11-16T16:58:23.759Z: Inject COMMIT_ID
2017-11-16T16:58:23.759Z: Inject APP_ID
2017-11-16T16:58:23.759Z: Inject APP_HOME
2017-11-16T16:58:23.759Z: Added sourceable file /home/bas/applicationrc
2017-11-16T16:58:23.760Z: Cache: GET /api/builds/app_eb1a2b85-ff92-4ce1-8372-bce5c986e729/d1b14f828333f5e3ba7d2734d86aa8234549fdae/java-20171005
2017-11-16T16:58:23.760Z: No build cache archive yet.
2017-11-16T16:58:24.024Z: Cloning into '/home/bas/app_eb1a2b85-ff92-4ce1-8372-bce5c986e729'...
2017-11-16T16:58:24.024Z: Warning: Permanently added 'push-par-clevercloud-customers.services.clever-cloud.com,212.129.46.93' (ECDSA) to the list of known hosts.
2017-11-16T16:58:24.788Z: Note: checking out 'd1b14f828333f5e3ba7d2734d86aa8234549fdae'.
2017-11-16T16:58:24.794Z: You are in 'detached HEAD' state. You can look around, make experimental
2017-11-16T16:58:24.794Z: changes and commit them, and you can discard any commits you make in this
2017-11-16T16:58:24.794Z: state without impacting any branches by performing another checkout.
2017-11-16T16:58:24.794Z: If you want to create a new branch to retain commits you create, you may
2017-11-16T16:58:24.795Z: do so (now or later) by using -b with the checkout command again. Example:
2017-11-16T16:58:24.795Z:  git checkout -b <new-branch-name>
2017-11-16T16:58:24.798Z: HEAD is now at d1b14f8... add clevercloud support
2017-11-16T16:58:24.803Z: Configuration file detected: /home/bas/app_eb1a2b85-ff92-4ce1-8372-bce5c986e729/clevercloud/jar.json
2017-11-16T16:58:24.803Z: using java version 8
2017-11-16T16:58:25.523Z: using python version 2
2017-11-16T16:58:25.524Z: Generating public/private rsa key pair.
2017-11-16T16:58:25.524Z: Your identification has been saved in /home/bas/.ssh/id_rsa.
2017-11-16T16:58:25.524Z: Your public key has been saved in /home/bas/.ssh/id_rsa.pub.
2017-11-16T16:58:25.524Z: The key fingerprint is:
2017-11-16T16:58:25.524Z: SHA256:rJ0r2IwsuUryxFjJ6T7z5ZYBtwlmEUs5cppBhv70lG4 bas@f0465687-a506-46ca-81ff-ae116d0a99ec
2017-11-16T16:58:25.524Z: The key's randomart image is:
2017-11-16T16:58:25.525Z: +---[RSA 1024]----+
2017-11-16T16:58:25.525Z: | oo oo           |
2017-11-16T16:58:25.525Z: |..o.=.           |
2017-11-16T16:58:25.525Z: |.  *.o.          |
2017-11-16T16:58:25.525Z: | oo+=o..         |
2017-11-16T16:58:25.525Z: |  Bo++ oS        |
2017-11-16T16:58:25.525Z: | = . E+o .       |
2017-11-16T16:58:25.526Z: |o.+o.=ooo        |
2017-11-16T16:58:25.526Z: |o+= +o*  .       |
2017-11-16T16:58:25.526Z: |..+*.....        |
2017-11-16T16:58:25.526Z: +----[SHA256]-----+
2017-11-16T16:58:25.526Z: Move ourselves to directory /home/bas/app_eb1a2b85-ff92-4ce1-8372-bce5c986e729
2017-11-16T16:58:25.526Z: We are now in /home/bas/app_eb1a2b85-ff92-4ce1-8372-bce5c986e729, let's build and run the app.
2017-11-16T16:58:25.526Z: Deploying commit ID d1b14f828333f5e3ba7d2734d86aa8234549fdae
2017-11-16T16:58:25.526Z: Detected jar app
2017-11-16T16:58:25.527Z: Inject POSTGRESQL_ADDON_USER
2017-11-16T16:58:25.527Z: Inject INSTANCE_NUMBER
2017-11-16T16:58:25.527Z: Inject CC_DEPLOYMENT_ID
2017-11-16T16:58:25.527Z: Inject POSTGRESQL_ADDON_HOST
2017-11-16T16:58:25.527Z: Inject POSTGRESQL_ADDON_DB
2017-11-16T16:58:25.527Z: Inject PORT
2017-11-16T16:58:25.527Z: Inject CC_PRE_RUN_HOOK
2017-11-16T16:58:25.528Z: Inject POSTGRESQL_ADDON_URI
2017-11-16T16:58:25.528Z: Inject CC_ENVIRON_UPDATE_TOKEN
2017-11-16T16:58:25.528Z: Inject POSTGRESQL_ADDON_PASSWORD
2017-11-16T16:58:25.528Z: Inject CC_REVERSE_PROXY_IPS
2017-11-16T16:58:25.528Z: Inject CC_ENVIRON_UPDATE_URL
2017-11-16T16:58:25.528Z: Inject JAVA_VERSION
2017-11-16T16:58:25.528Z: Inject POSTGRESQL_ADDON_PORT
2017-11-16T16:58:25.529Z: Inject INSTANCE_TYPE
2017-11-16T16:58:25.529Z: Inject INSTANCE_ID
2017-11-16T16:58:25.529Z: Inject COMMIT_ID
2017-11-16T16:58:25.529Z: Inject APP_ID
2017-11-16T16:58:25.529Z: Inject APP_HOME
2017-11-16T16:58:25.529Z: Inject file.encoding
2017-11-16T16:58:25.529Z: Added env data as a properties file.
2017-11-16T16:58:25.529Z: Creating build cache archive
2017-11-16T16:58:36.274Z: build cache archive created
2017-11-16T16:58:36.274Z: Error: The given jarName (sponsor-0.0.1-SNAPSHOT.war) does not exist.
2017-11-16T16:58:36.274Z: Deploy failed
2017-11-16T16:58:36.274Z: Deploy failed in 0 minutes and 13 seconds. Please review the lines above to find out why
ldoguin commented 6 years ago

The generator only works when at the root of the project. We need to autodetect the relative path of the project if there is one and modify the configuration accordingly.

agoncal commented 6 years ago

@ldoguin I moved the clevercloud directory down, so now I have:

├── .clever.json
├── .git
├── clevercloud/
|    ├── application-clevercloud.yml
|    └── maven.json
├── sponsors-api
├── sponsors-monolith
└── sponsors-ui

and changed the directory for the jar "jarName": "./sponsors-monolith/target/sponsor-0.0.1-SNAPSHOT.war" but I still get Error: The given jarName (sponsor-0.0.1-SNAPSHOT.war) does not exist.

Do I have to change something else?

RudyBaer commented 5 years ago

I think it's because jhipster does not use baseName from .yo-rc.json to generate war name but artifactId from pom.xml You have to edit jar name manualy in maven.json file to fix it