Error while building maven project s4hana cloud sdk - sap-cloud-sdk

with RELEASE version mentioned in archeType its giving this error
Execution default of goal
com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:2.19.1:usage-analytics
failed: Plugin com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:2.19.1
or one of its dependencies could not be resolved: Failed to collect
dependencies at
com.sap.cloud.s4hana.plugins:s4sdk-maven-plugin:jar:2.19.1 ->
com.sap.cloud.s4hana.plugins:usage-analytics:jar:2.19.2-SNAPSHOT
at the time of mvn clean install

This error hints at a problem with your local Maven repository, which seems to contain a newer SNAPSHOT version.
Either use mvn clean install -U to force an update of dependencies, or delete your local .m2 folder to download dependencies again.

Related

When we build any freestyle project in Jenkins, does Maven comes into picture in the background?

Maven requires a POM.XML file for installing dependencies, but if we have a NodeJS application, the dependencies are mentioned in the node modules folder, and for normally installing them we do npm install. So if we are using Jenkins and created a freestyle project for automating the installation of dependencies, will this freestyle project use Maven for building and installing the dependencies?
If yes, then what happens in the background? Any POM.XML file is created for the dependencies mentioned in node modules?
A freestyle project is, as name suggests, a free style. You have to configure everything from SCM, Build Environment, Build triggers, Execution and Post job execution if any.
This means, the job is independent of the language/build tool you have for your source code.
If you have node and using npm, configure Build execution as npm install.
If you have java and using ant, use ant -f build.xml.
If you have java and using maven, use mvn clean install.
and so on...
Whatever you configure as a build execution, that task will be executed in background and accordingly, required package(s) will be generated.

how to use npm to install all node modules in local network?

My node app will deploy in a bank that can't access the internet. Can I download all the node modules in a local directory, and install them from it, or just copy the node_modules to the bank machines? Any safe and practical advise will be highly appreciated, thank you.
OR
How to add node_modules dependencies without using internet .
Add offline-npm to your project to serve a npm compatible tgz file wich contains all dependencies for offline installation with npm install.
Additionally you can use offline-npm -n to install packages from your local npm cache directory
For installation
npm install -g offline-npm
Usage
1) Open terminal and go to your project you want to prepare for offline use. This folder needs to contain a package.json file.
2) Prepare your project for offline use
offline-npm --add
3) This changes the package.json file and adds a offline folder which will contain all your dependencies.
Pack your project
npm pack
For more details , visit the Link
Hope this answer gets useful to you .
Typically you will want to bundle your node_modules into your deployable artifact.
There are some gotchas here around any native dependencies as you need to match the nodejs version of the build environment with the target system.
The easiest way to achieve this in my experience is by using docker to build and package your deployment. Though it is possible to do when running directly on host machines, you may find it safest to just avoid the usage of native dependencies to remove any risk of things breaking from a nodejs or os update.
I've also successfully achieved this packaging the nodejs binary into my deployment artifact that was deployed directly on centos hosts, however we had a mixture of centos 6 and centos 7 hosts at the time, which brought additional complexity related to different glibc versions causing nodejs to fail to start with the system provided library.
In short if you can I would use docker to package your application into a completely self contained image.
you can just copy the node_modules into the deployment machine but it is bad practice.
there are other solutions like using local-npm package... your npm installs are fetched from the registry and then modules and their dependencies get stored in a local PouchDB database. This caches them so subsequent npm installs use the local cache rather than calling to the network. local-npm also takes care of keeping modules updated when they change. It does this by listening for changes to the remote registry so you don't have to worry about staleness.
or bundling your packages to use them offline you could visit this link for more details for offline installation of npm packages:
https://addyosmani.com/blog/using-npm-offline/
How to install node modules in local network?
1. Solution: yarn offline and 'Offline Mirro'
One of the main advantages of Yarn is that it can install node_modules from files located in file system. We call it “Offline Mirror” because it mirrors the files downloaded from registry during the first build and stores them locally for future builds.
2. New problem: How to use yarn in local network?
Download yarn.tar.gz into the local repository, and install it in local node_modules directory.
npm install yarn.tar.gz --no-save
3. Usage
# run yarn install, and download the node modules (.tar.gz) into the offline mirror directory '$REPOSITORY/yarn/yarn-offline-mirror'.
npm run online-install
# with yarn.lock file, install node_modules from offline mirror directory '$REPOSITORY/yarn/yarn-offline-mirror'
npm run offline-install
4. Problems
4.1. problem 1
4.1.1. description
error can`t make a request in offline mode("http://....")
4.1.2. reason
the indirect dependencies could not be downloaded into offline mirror directory
4.1.3. resolution
yarn config set yarn-offline-mirror-pruning false
5. Github demo
yarn-offline-deploy-demo
6. Reference
1. Running Yarn offline

Trouble Installing "mobius-client-js"

Keep failing to install mobius-client-js"
C:\WINDOWS\system32>yarn add #mobius-network/mobius-client-js
yarn add v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
error #mobius-network/mobius-client-js#0.5.0: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.14.1"
error Found incompatible module
Per Yarn's docs, you can use the following methods to add:
You can also specify packages from different locations:
yarn add package-name installs the package from the npm registry
unless you have specified another one in your package.json.
yarn add file:/path/to/local/folder installs a package that is on
your local file system. This is useful to test out other packages of
yours that haven’t been published to the registry.
yarn add file:/path/to/local/tarball.tgz installs a package from a
gzipped tarball which could be used to share a package before
publishing it.
yarn add <git remote url> installs a package from a remote git
repository.
yarn add <git remote url>#<branch/commit/tag> installs a package from
a remote git repository at specific git branch, git commit or git tag.
yarn add https://my-project.org/package.tgz installs a package from a
remote gzipped tarball.
None are working... any help would be amazing.
As per your error message:
The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.14.1"
It looks like you are running NodeJS 10.14.1, but the mobius-client requires a NodeJS version between 4 and 9. You should either check if there's a compatible version of this library or use something like nvm to switch to a previous version of node.

Getting started guide for Jhipster 4 latest state

Can someone post getting started guide for Jhipster 4.0 with angular 2?
I don't care if it is not released. I just want to generate code with latest code on github and move on.
Thanks.
Update - wikipage published by Deepu on github:
https://github.com/jhipster/generator-jhipster/blob/master/NG2-GUIDE.md
I figured out myself. But I cannot speak for the current state since I am not a developer.
Installation prerequisites:
JDK(and JAVA_HOME env variable set), git client, npm, maven or gradle
First create a directory where you want to clone jhipster angular-2 branch. Then from that directory execute:
git clone -b angular-2 --single-branch https://github.com/jhipster/generator-jhipster.git
cd generator-jhipster
npm link
npm install -g gulp bower
Create app directory and from there
yo jhipster
Ignore upgrade offer and in the second question select Angular-2(beta)
Run the app
In case you picked Maven:
mvn spring-boot:run
In case you picked Gradle:
gradle bootRun

How to check out a JHipster project in multiple development environments

I'm evaluating JHipster; it looks great for rapid development!
Maybe a novice question: I see that the generated .gitignore ignores certain things, e.g.
/node/**
/node_modules/**
So, if I check in the generated project to a repository, and then some other developer in my team checks it out in his environment, the project would not work in his environment. Would it?
Was curious to know how to handle this. Thanks.
Since your git repo won't track node packages, others using your git repo will need install node.js, then run npm install to download all the node packages.
It's similar to them having to have java and maven installed on their environment.
Update: A developer will run 'git clone '. The source (not including node or bower) will be on their workstation. Once they've installed node.js, they'll run 'npm install' and the node directories will be created automatically for your project by downloading them from the Internet. That way you don't need to keep all your node libraries in your own git repository ...just their package name and version in the package.json file (similar to maven dependencies in pom.xml).
No one should commit the node_modules or bower_components to git, what you would do is share the project like you share the maven projects.
Write in the read me what needs to be done to get them ready, for example the installation of yo, bower, grunt or gulp and generator-jhipster.
What is very nice about liquibase, each developer can have his own version of the database, and every commit has its own database version.
What we our team does, if a developer adds something to node js package.json then we mention it in the comment: npm install needed and the same applies for bower.
That way you keep all your environments clean, and if you would like to install continuous integration like "Jenkins or Teamcity" then you make sure Jenkins is building rebuilding the whole project.

Resources