How does the jar work below?

It appears as though the jar: in the Makefile.inc is intended to let users call
jar: from the individual bean Makefiles. This would proceed to try and execute
jar from the nested bean directory.

I've been playing around with jar (blackdown jdk v1.1.7), and it seems that I am
not able to create an ejb-jar file unless I am currently in the top level
directory.

i.e. if my directory structure is  src/A/B/C, and I want to build an ejb-jar for
a bean that lies in directory C, then I have to cd into src and execute jar from
there.

I cannot find a way to be sitting in C and build the ejb-jar file.

The following is the closest guess I have: (assume we are in directory C)

jar cmvf manifest TestEJB.jar ../../../A/B/C/Test*.class ../../../A/B/C/Test.ser

but this produces an error because the Name: in the manifest file is "incorrect"
given that I am lying in the directory C

Name: A/B/C/Test.ser
Enterprise-Bean: True

Any help or suggestions?

--shawn





Jim Richards wrote:
> 
> Yeah, I guess my makefile is more generic then this, I have attched them,
> there are four files, three called Makefile and one Makefile.inc
> 
> There are a few things you'll need to edit,
> 
> BEAN_PATH is one, which should match your package names,
> TOP_DIR is where the top directory of the project lives (could be an environment var)
> 
> and the two at the bottom are for entity and sesion beans ...
> 
> ##
> # Makefile for root of project tree
> #
> 
> ##
> # customise start
> BEAN_PATH       =       org/cyber4/engine/ejb/user \
>                         org/cyber4/engine/ejb/session_history \
>                         org/cyber4/engine/ejb/user_activity \
>                         org/cyber4/engine/ejb/system_activity \
>                         au/com/wemyss/engine/ejb/main_activity \
>                         au/com/wemyss/engine/ejb/item_activity \
>                         au/com/wemyss/engine/ejb/item
> 
> # customise end
> ##
> 
> all:
>         @for i in $(BEAN_PATH); do \
>                 echo "==> $$i"; \
>                 ( cd $$i && $(MAKE) ) || exit 1; \
>                 echo "<== $$i"; \
>         done
> 
> rubbish:
>         @find . -type f \( -name "*.~*" -o -name "*.dependency" \) -print | xargs rm
> 
> clean:
>         @for i in $(BEAN_PATH); do \
>                 echo "==> $$i"; \
>                 ( cd $$i && $(MAKE) clean ) || exit 1; \
>                 echo "<== $$i"; \
>         done
> 
> clobber:
>         @for i in $(BEAN_PATH); do \
>                 echo "==> $$i"; \
>                 ( cd $$i && $(MAKE) clobber ) || exit 1; \
>                 echo "<== $$i"; \
>         done
> 
> ##
> # Makefile.inc, Include file for SessionBean and EntityBean Makefile's
> #
> 
> ##
> # start user configurable part
> 
> TOP_DIR         =       /cyber4/projects/devel/wemyss-online/jserv
> 
> # end user configurable part
> ##
> 
> JAR             = jar
> JAVAC           = javac -O
> RM              = rm -f
> SER             = GenDD
> CHECK_EJB       = CheckEJB
> SUPP            = GenIC
> 
> CLASSPATH       +=      :$(TOP_DIR)
> 
> BEAN_PKEY       =       $(BEAN_PK).class
> 
> BEAN_CLASS      =       $(BEAN_HOME).class \
>                         $(BEAN_REMOTE).class \
>                         $(BEAN_NAME).class
> 
> BEAN_SER        =       $(BEAN_NAME).ser
> 
> BEAN_HANDLE     =       Bull$(BEAN_NAME)$(BEAN_REMOTE)Handle.class
> 
> BEAN_SUPP       =       Bull$(BEAN_NAME)$(BEAN_REMOTE).class \
>                         Bull$(BEAN_NAME)$(BEAN_REMOTE)_Skel.class \
>                         Bull$(BEAN_NAME)$(BEAN_REMOTE)_Stub.class \
>                         Bull$(BEAN_NAME)$(BEAN_HOME).class \
>                         Bull$(BEAN_NAME)$(BEAN_HOME)_Skel.class \
>                         Bull$(BEAN_NAME)$(BEAN_HOME)_Stub.class
> 
> .SUFFIXES:      .java .txt .properties .class .ser
> 
> session : $(BEAN_CLASS) $(BEAN_SER) $(BEAN_SUPP)
> entity : $(BEAN_PKEY) $(BEAN_CLASS) $(BEAN_SER) $(BEAN_SUPP) $(BEAN_HANDLE)
> 
> .properties.txt:
>         touch $@
> 
> .java.class:
>         $(JAVAC) -d $(TOP_DIR) $<
>         touch $(BEAN_NAME).properties
> 
> .txt.ser:
>         $(SER) $<
>         $(CHECK_EJB) $@
> 
> $(BEAN_SUPP): $(BEAN_CLASS) $(BEAN_SER)
>         $(SUPP) -d $(TOP_DIR) $(BEAN_SER)
> 
> $(BEAN_HANDLE): $(BEAN_PKEY) $(BEAN_CLASS) $(BEAN_SER)
>         $(SUPP) -d $(TOP_DIR) $(BEAN_SER)
> 
> jar: manifest $(BEAN_CLASS) $(BEAN_SER) $(BEAN_SUPP) $(BEAN_HANDLE)
>         $(JAR) cmvf manifest $(TOP_DIR)/$(BEAN_REMOTE).jar $(BEAN_SER) $(BEAN_CLASS) 
>$(BEAN_SUPP) $(BEAN_HANDLE)
> 
> clean:
>         $(RM) $(BEAN_SER) $(BEAN_CLASS) $(BEAN_PKEY) $(BEAN_SUPP) $(BEAN_HANDLE) 
>Bull*.java Bull*.save *.~jav *.~tx
> 
> clobber: clean
>         $(RM) $(TOP_DIR)/$(BEAN_REMOTE).jar
> 
> ##
> # EntityBean Makefile, with BEAN_PK
> #
> 
> ## customise start ##
> BEAN_REMOTE     =       User
> BEAN_PK         =       UserPK
> BEAN_HOME       =       UserHome
> BEAN_NAME       =       UserBean
> all : entity
> ## customise end ##
> 
> include ../../../../../Makefile.inc
> 
> ##
> # SessionBean makefile, as there is no BEAN_PK
> #
> 
> ## customise start ##
> BEAN_REMOTE     =       UserActivity
> BEAN_HOME       =       UserActivityHome
> BEAN_NAME       =       UserActivityBean
> all : session
> ## customise end ##
> 
> include ../../../../../Makefile.inc
> 
> --
> Subvert the dominant paradigm
>  http://www.cyber4.org/members/grumpy/index.html

Reply via email to