Apache Zeppelin - Cannot load dependency from custom maven repo - apache-zeppelin

I have my library which I host in my custom maven repo. I want to use in the notebook. However when I try to load it it tries to load them from central repo instead of my custom repo
My zeppelin code:
%dep
z.reset();
z.addRepo("myTeam").url("http://maven.myHost.com/repository/myTeam").username("username").password("password");
z.load("myTeam:normalization-cache:jar-with-dependencies:1.1.14");
And this is the output
org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact myTeam:normalization-cache:jar-with-dependencies:1.1.14 in central (http://repo1.maven.org/maven2/)
So it always looks for the dependency in the central repo. How to change it so it could get it from my repo ?

Related

Embedding react application's build into Drupal

Primarily, I'm trying to integrate a react application (Created and build separately) with Drupal.
Problem
Unable to install private package from Bitbucket using npm install git#bitbucket.org:user/shared-package.git in Drupal app, because no package.json found.
Implementation Details
Development Environment
To achieve this in development environment I run npm run build which produces the following content in dist directory.
Not going in the details of what are the roles of other files but to make the things work, I just need to copy bundle.js file and paste it inside a directory under app/web/themes/custom/abc_themes/js/.
This is okay for development environment to copy a folder from one project and paste it into another. However, for production environment it' not viable.
Production Environment
In production we thought to create a private package on Bitbucket, where through Bitbucket pipelines on every commit we trigger a build and push that build 's result into a separate repo (i.e. private package).
Here is the content that is pushed to the so-called private package. Since it's the entire react application (not a library) therefore when it builds it creates compiled js and doesn't contain packgae.json.
Now if I try to install this package throught npm install
code ENOLOCAL
npm ERR! Could not install from "bitbucket.org:user/shared-package.git" as it does not contain a package.json file.
That is obvious but to solve this I can't convert my project into a library. Because even if I convert it to a library, Drupal needs a build js file at the specified directory to work.
Expectation
Want to know if there is a way I could install that private package (that doesn't have package.json) into Drupal application.
OR any other way around to achieve the same.
NOTE: I know one solution could be to host the build file at some CDN and pull it from there. But problem is, the Drupal app might be running behind a corporate network and users won't be able to access the internet openly. Therefore, we want to make the react app a part of build process, so once Drupal is served, react application would be a part of it already. No loading at runtime.

tomcat8 Maven plugin

Is anyone having idea on status of tomcat8 Maven Plugin. Is it ready for use or not ? I can locate the repository for it here but could not find this plugin on apache site. I tried using it with same configuration as that of tomcat7-maven-plugin but it does not start my application.
Go to following link
https://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat8-maven-plugin/3.0-r1756463
copy paste the dependency tag
<dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-r1756463</version>
But still if your pom file shows can't locate repository
click on the download link in above url and download jar file and past it in <your-home-directory>/.m2/repository/org/apache/tomcat/maven/tomcat8-maven-plugin/3.0-r1756463
In your IDE update maven project
tomcat maven plugin is only available for tomcat7, you can try spring boot which has an embedded tomcat8, it also provides other containers, like jetty

Angular2 with maven project

I have a question, I want to use angular 2 in maven project, and as you now the modules should download with ( npm install or ng new .. (cli) ).
The problem is if I generate the war file with all this modules, it will be very large because of the presence of all the nodejs modules.
In one of Github example they install this modules with ( npm install ) and finally goes to the home directory and run spring-boot:run
I want directly deploy my war file, so my question is : i should generate the war file with the all the modules and dependencies of nodejs or there is another solution ?
Three ways:
add all node_modules dependencies in to your version control, so source is always there, or copy necessary js libraries manually in specific source folder, like angular.min.js and so on (if your node.js is not available on your server, by security reason)
create execution goal inside pom.xml, something like
How to deploy a node.js app with maven?
use https://github.com/eirslett/frontend-maven-plugin and check existing examples, I am sure your case is straight forward

Why do I need to install node.js and git to learn AngularJS?

I am presently reading Manning's AngularJS in Action by Lukas Ruebbelke
The introductory part suggests,
Because you’re pulling files from a CDN, you’ll need to run
Angello Lite(the application name) from a web server. There are a few ways to do this, but one of the easiest ways is to use the npm package serve.
The steps for installing Angello Lite are as follows:
■ Install Node.js. You can find all of the information to do that at http://
nodejs.org/.
■ Install the serve package by running npm install -g serve from the command
line.
■ Download Angello Lite from GitHub, using the URL given above, and place it
on your local machine in a directory named angello-lite.
■ Navigate to the angello-lite directory from the command line and run serve.
■ Go to http://localhost:3000 in your browser to see the application.
Does learning Angular JS require previous exposure to node and git?
If I have Apache Tomcat already configured on my local m/c, what is the procedure to start with it?
Furthermore, just to keep in sync with the author, I installed git and then cloned a dir onto my local m/c from github.
Then i install node.js and Install the serve package by runningnpm install -g servefrom the command line.
Unfortunately when i navigate to the angello-lite directory from the command line and run serve, it shows me
where angello-lite is the repository where the application resides?
Any suggestions on how to configure successfully?
I have no idea regarding node.js and git. Do i really need to learn
these to begin with AngularJS then.
No, that's not a requirement. You don't even need a web server. You can have your static HTML files locally or use some online service like plnkr. Obviously if you need to work with dynamic data then you will need a web server. At some point you might want to start making AJAX calls in order to fetch some dynamic data from your server backend.
If I have Apache Tomcat already configured on my local m/c, what is
the procedure to start with it?
Just add an HTML page to the root of your website, open your favorite browser and invoke this page.
You don't need those tools to learn Angular - you can download latest package from the AngularJS website (both for development and for production).
Node.js and Git may be necessary to pull and build packages from the NPM, run tasks and many more great features, but just to learn Angular all you need is its code.

How to create a personally hosted package registry like bower

I'm looking to create a package registry for components or add-ons for the Ionic Framework, where one would be able to:
View / search packages on a website
Upload new packages (components) to the registry
Download packages from the registry
It would almost be a replica of the Bower registry. There would be a nice front-end for viewing and searching the available components inside of the registry. And a CLI would be necessary for downloading and uploading the packages/components from and to the registry.The registry could link to git/github repos just like bower.
Basically I'm asking how does Bower work, how does it store all of the packages? how does the CLI download the package for the github repo? And how can I replicate it for my own personal use?
Ideally I would like to write the whole thing in NodeJS + MongoDB + AngularJs.
Bower uses your repo Git tags to manage module versioning, it doesn't store the code like npm does. Each time you push a new Tag to GitHub it becomes available as a version for your Bower module. Bower simply constructs the tar/zip/git (not 100% sure which it uses) download link for the Git tag.
Bower does have a DB of course to manage users and published modules.

Resources