Are all EJBs deployed as JAR? - jar

When looking at how Netbeans uses ant to build an Enterprise Application, packaged as an EAR file:
library-inclusion-in-manifest:
[copy] Copying 1 file to /home/thufir/NetBeansProjects/netbeansEnterpriseApp/build/lib
-do-ear-dist:
[mkdir] Created dir: /home/thufir/NetBeansProjects/netbeansEnterpriseApp/netbeansEnterpriseApp-ejb/dist
[jar] Building jar: /home/thufir/NetBeansProjects/netbeansEnterpriseApp/netbeansEnterpriseApp-ejb/dist/netbeansEnterpriseApp-ejb.jar
-post-dist:
dist-ear:
pre-pre-compile:
pre-compile:
-do-compile-deps:
[copy] Copying 1 file to /home/thufir/NetBeansProjects/netbeansEnterpriseApp/build
do-compile:
[copy] Copying 1 file to /home/thufir/NetBeansProjects/netbeansEnterpriseApp/build/META-INF
post-compile:
compile:
pre-dist:
do-dist-without-manifest:
do-dist-with-manifest:
[mkdir] Created dir: /home/thufir/NetBeansProjects/netbeansEnterpriseApp/dist
[jar] Building jar: /home/thufir/NetBeansProjects/netbeansEnterpriseApp/dist/netbeansEnterpriseApp.ear
post-dist:
dist:
BUILD SUCCESSFUL
Total time: 1 second
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp$
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp$ tree
.
├── build
│   ├── lib
│   │   └── netbeansRemoteInterface.jar
│   ├── META-INF
│   │   └── MANIFEST.MF
│   └── netbeansEnterpriseApp-ejb.jar
├── build.xml
├── dist
│   └── netbeansEnterpriseApp.ear
├── nbproject
│   ├── ant-deploy.xml
│   ├── build-impl.xml
│   ├── genfiles.properties
│   ├── private
│   │   └── private.properties
│   ├── project.properties
│   └── project.xml
├── netbeansEnterpriseApp-ejb
│   ├── build
│   │   ├── classes
│   │   │   ├── ejb
│   │   │   │   └── NewSessionBean.class
│   │   │   ├── META-INF
│   │   │   │   └── MANIFEST.MF
│   │   │   └── netbeansRemoteInterface.jar
│   │   ├── empty
│   │   └── generated-sources
│   │   └── ap-source-output
│   ├── build.xml
│   ├── dist
│   │   └── netbeansEnterpriseApp-ejb.jar
│   ├── nbproject
│   │   ├── ant-deploy.xml
│   │   ├── build-impl.xml
│   │   ├── genfiles.properties
│   │   ├── private
│   │   │   └── private.properties
│   │   ├── project.properties
│   │   └── project.xml
│   └── src
│   ├── conf
│   │   └── MANIFEST.MF
│   └── java
│   └── ejb
│   └── NewSessionBean.java
└── src
└── conf
└── MANIFEST.MF
23 directories, 25 files
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp$
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp$ asadmin deploy dist/netbeansEnterpriseApp.ear
Application deployed with name netbeansEnterpriseApp.
Command deploy executed successfully.
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp$
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp$ asadmin list-applications
netbeansEnterpriseApp <ear, ejb>
Command list-applications executed successfully.
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp$ cd dist/
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$ ls
netbeansEnterpriseApp.ear
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$ jar xf netbeansEnterpriseApp.ear
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$ ll
total 40
drwxr-xr-x 4 thufir thufir 4096 Nov 11 19:29 ./
drwxrwxr-x 7 thufir thufir 4096 Nov 11 19:28 ../
drwxr-xr-x 2 thufir thufir 4096 Nov 11 19:28 lib/
drwxr-xr-x 2 thufir thufir 4096 Nov 11 19:28 META-INF/
-rw-r--r-- 1 thufir thufir 2834 Nov 11 19:28 netbeansEnterpriseApp.ear
-rw-r--r-- 1 thufir thufir 1351 Nov 11 19:28 netbeansEnterpriseApp-ejb.jar
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$ ll lib/
total 20
drwxr-xr-x 2 thufir thufir 4096 Nov 11 19:28 ./
drwxr-xr-x 4 thufir thufir 4096 Nov 11 19:29 ../
-rw-r--r-- 1 thufir thufir 782 Nov 11 19:28 netbeansRemoteInterface.jar
thufir#dur:~/NetBeansProjects/netbeansEnterpriseApp/dist$
I notice that, when deployed to Glassfish, both EAR and EJB are listed. On its own, an EJB is packaged as a JAR? There's no such thing as an EJB packaged as an EAR? (Rather, any EJB packaged in an EAR or WAR ultimately is deployed as a JAR -- to my understanding.)
Or, are there EJB which are not deployed as JAR files?

Yes, the EJBs in the WAR do not need to be packaged as Jar, if your applicationserver (as jboss7 and wildfly) supports this.
The ejb-classes can be found inside the WAR in WEB-INF/classes.
An example project used for tests you can find at ejb-cdi-unit-test-war. If you try and clone you will need maven to build the project.

Related

Ignore dags in subfolders using .airflowignore

I have the following dir structure:
.
├── project
│   ├── dag_1
│   │   ├── dag
│   │   │   ├── current
│   │   │   └── dag_1_v2.py
│   │   │   └── deprecated
│   │   │   └── dag_1_v1.py
│   │   └── sparkjobs
│   │   ├── current
│   │   └── deprecated
│   └── dag_2
│      ├── dag
│      │   ├── current
│      │   └── dag_2_v2.py
│      │   └── deprecated
│      │   └── dag_2_v1.py
│   └── sparkjobs
│   ├── current
│   └── deprecated
I want to ignore all deprecated folders, so I used .airflowignore to do that. When I place .airflowignore with */deprecated inside dag_1 or dag_2 folder, Airflow ignores the deprecated dag, like:
├── project
│   ├── dag_1
│   │   ├── .airflowignore
│   │   ├── dag
│   │   │   ├── current
│   │   │   └── dag_1_v2.py
│   │   │   └── deprecated
│   │   │   └── dag_1_v1.py
Considering this, I'll have to place a .airflowignore inside each dag folder. When I try to put onlny one .airflowignore using **/**/deprecated in the project folder the deprecated dags returns to Airflow, like:
├── project
│   ├── .airflowignore
│   ├── dag_1
│   │   ├── dag
│   │   │   ├── current
│   │   │   └── dag_1_v2.py
│   │   │   └── deprecated
│   │   │   └── dag_1_v1.py
My question is: How can I have only one .airflowignore in the project dir level to ignore all deprecated folders inside each dag_n/dag folder? Is this possible?
.airflowignore has same logic as .gitignore so what ever solution applies to .gitignore will also work here.
I believe what you are after is just
deprecated/
on the top level.
See also ignoring any 'bin' directory on a git project

How do I change Bulma's default styling?

I've installed sass as instructed here http://versions.bulma.io/0.7.0/documentation/components/navbar/#variables. The guide says I need to include my change from $navbar-item-hover-background-color: $background to $navbar-item-hover-background-color: #28567d before bulma.sass gets imported.
I haven't seen a line with #import bulma.sass or #import bulma on it though.
the directory tree may be helpful:
.
├── bulma.sass
├── CHANGELOG.md
├── css
│   ├── bulma.css
│   └── bulma.css.map
├── LICENSE
├── package.json
├── README.md
└── sass
├── base
│   ├── _all.sass
│   ├── generic.sass
│   ├── helpers.sass
│   └── minireset.sass
├── components
│   ├── _all.sass
│   ├── breadcrumb.sass
│   ├── card.sass
│   ├── dropdown.sass
│   ├── level.sass
│   ├── media.sass
│   ├── menu.sass
│   ├── message.sass
│   ├── modal.sass
│   ├── navbar.sass
│   ├── pagination.sass
│   ├── panel.sass
│   └── tabs.sass
├── elements
│   ├── _all.sass
│   ├── box.sass
│   ├── button.sass
│   ├── container.sass
│   ├── content.sass
│   ├── form.sass
│   ├── icon.sass
│   ├── image.sass
│   ├── notification.sass
│   ├── other.sass
│   ├── progress.sass
│   ├── table.sass
│   ├── tag.sass
│   └── title.sass
├── grid
│   ├── _all.sass
│   ├── columns.sass
│   └── tiles.sass
├── layout
│   ├── _all.sass
│   ├── footer.sass
│   ├── hero.sass
│   └── section.sass
└── utilities
├── _all.sass
├── animations.sass
├── controls.sass
├── derived-variables.sass
├── functions.sass
├── initial-variables.sass
└── mixins.sass
I've tried to edit navbar.sass:
$navbar-item-hover-background-color: #28567d !default
and then rebuild the bulma.css file with sass bulma.sass bulma.css
It had no effect though.
Any assistance much appreciated.

How to move files found with pattern and move to another subdirectory in unix

I have this:
.
├── dirA
│   └── ProdA
│   ├── Brief
│   │   └── Form.xlsx
│   ├── Results
│   └── Studies
└── dirB
└── BrandB
└── ProdB
├── Brief
│   └── Form.xlsx
└── Results
and i want this:
.
├── dirA
│   └── ProdA
│   ├── Brief
│   ├── Results
│   └── Studies
│      └── Form.xlsx
└── dirB
└── BrandB
└── ProdB
├── Brief
└── Results
└── Studies
└── Form.xslx
So basically i have to find files Form.xlsx and move it from subdirectory Brief to subdirectory Studies (create it if it does not exists), both at the same level.
when i do:
find . -name '*.xlsx' -exec mv '{}' ../Studies ';'
I got:
.
├── dirA
│   └── ProdA
│   ├── Brief
│   ├── Results
│   └── Studies
└── dirB
└── BrandB
└── ProdB
├── Brief
└── Results
You shouldn't use .. to get the matched file's parent directory, use dirname instead.
find . -name "*.xlsx" -exec sh -c 'mv {} "$(dirname $(dirname {}))/Studies/"' \;
Have a try! :)

tree terminal command: Avoid printing all sub folders/files and putting limit

I would like to print all the subdirectories and files from a certain directory. But some of the subfolders have humungous number of files and I would like to cap the number of subdirectories/files they print for each subfolder where it goes over that cap. How do I do it?
Currently I have this situation:
/data$ tree
.
├── filenames.json
├── tripletlists
│   ├── class_tripletlist_test.txt
│   ├── class_tripletlist_train.txt
│   ├── class_tripletlist_val.txt
│   ├── closure_tripletlist_test.txt
│   ├── closure_tripletlist_train.txt
│   ├── closure_tripletlist_val.txt
│   ├── gender_tripletlist_test.txt
│   ├── gender_tripletlist_train.txt
│   ├── gender_tripletlist_val.txt
│   ├── heel_tripletlist_test.txt
│   ├── heel_tripletlist_train.txt
│   └── heel_tripletlist_val.txt
└── ut-zap50k-images
├── Boots
│   ├── Ankle
│   │   ├── adidas
│   │   │   ├── 8030969.3.jpg
│   │   │   └── 8030970.107722.jpg
│   │   ├── adidas Kids
│   │   │   ├── 8070145.388249.jpg
│   │   │   └── 8070146.388250.jpg
│   │   ├── adidas Originals
│   │   │   ├── 8027274.372160.jpg
│   │   │   ├── 8027274.372161.jpg
│   │   │   ├── 8027310.115329.jpg
│   │   │   ├── 8027310.183092.jpg
│   │   │   ├── 8027320.372147.jpg
│   │   │   └── 8027320.372178.jpg
│   │   ├── adidas Originals Kids
│   │   │   ├── 8025627.371498.jpg
│   │   │   ├── 8025627.74095.jpg
│   │   │   ├── 8025719.11196.jpg
You can use the flag --filename N in tree --filenames N where N is the number of caps. For example, if I just want to print maximum of four subdirectories or files per subdirectory, you can youse tree --filename 4.
>> ls
filenames.json tripletlists ut-zap50k-images
>> tree --filelimit 4
.
├── filenames.json
├── tripletlists [12 entries exceeds filelimit, not opening dir]
└── ut-zap50k-images
├── Boots [5 entries exceeds filelimit, not opening dir]
├── Sandals
│   ├── Athletic [6 entries exceeds filelimit, not opening dir]
│   ├── Flat [314 entries exceeds filelimit, not opening dir]
│   └── Heel [25 entries exceeds filelimit, not opening dir]
├── Shoes [10 entries exceeds filelimit, not opening dir]
└── Slippers
├── Boot [6 entries exceeds filelimit, not opening dir]
├── Slipper Flats [77 entries exceeds filelimit, not opening dir]
└── Slipper Heels
├── Daniel Green [8 entries exceeds filelimit, not opening dir]
└── L.B. Evans
├── 7590239.255.jpg
└── 7590239.72.jpg

Generate a list or map of css files

I'm starting to work on a new app at my company. I'm hoping to run a quick process that will generate an outline, tree, or other map-type thing of all of the CSS and SASS files in the app directory.
I know I can grep it, but I wanted to see if someone had something more targeted I could use.
If you're simply looking to generate a tree, the common tree command can filter by file type if provided a pattern. Maybe this will help:
tree -P "*.css" --prune
The -P option allows you to match a pattern, and the --prune option hides empty folders (or ones which don't contain match files).
It's a pretty nifty tool; here's some sample output from tree -P "*.js" --prune on a node project directory:
.
├── Authorize.js
├── collections.js
├── functions
│   ├── downloadImage.js
│   ├── generateThumbnails.js
│   ├── hashImage.js
│   ├── loadMedia.js
│   └── uploadFile.js
├── node_modules
│   ├── body-parser
│   │   ├── index.js
│   │   ├── lib
│   │   │   ├── read.js
│   │   │   └── types
│   │   │   ├── json.js
│   │   │   ├── raw.js
│   │   │   ├── text.js
│   │   │   └── urlencoded.js
│   │   └── node_modules
│   │   ├── bytes
│   │   │   └── index.js
│   │   ├── content-type
│   │   │   └── index.js
More documentation here: http://www.computerhope.com/unix/tree.htm

Resources