cancel
Showing results for 
Search instead for 
Did you mean: 

How to deploy customizations in a nuxeo instance?

Dirk_Wenke
Confirmed Champ
Confirmed Champ

Hi, I created some bundles in Nuxeo IDE to extend nuxeo features. I created them as Nuxeo Plugin Projects. In one of these bundles I made some customizations to the login screen. I did it like it was mentioned in some of the tutorials or forum threads:

  • I copied the login.jsp to /src/main/resources/nuxeo.war/login.jsp
  • I modified the login.jsp according to my needs. If I start the server out of Nuxeo IDE together with my bundles, everything is working properly. But now I tried to run my bundles in a separate nuxeo installation. To do that I exported my plugins out of the IDE by triggering "Nuxeo>Export JAR" from the context menu of my project. Then i copied the exported jars to /nxserver/bundles.

My other bundles are working propertly in the new nuxeo instance. But I think that my customizations are somehow overwritten by the defaults at server startup. What do I have to do to make my customizations override the defaults? The bundles created in NuxeoIDE do not contain a deployment-fragment.xml, is this the problem? If it is, what must be the content of that file?

Thanks, Dirk

1 ACCEPTED ANSWER

bruce_Grant
Elite Collaborator
Elite Collaborator

Yes you need a deployment-fragment.xml in the OSGI-INF folder. It will need to be modified to meet your requirements. For example, if you have no messages.properties to append/override then remove those lines. Best to look at the Nuxeo sources for examples of what can go in the deployment fragment.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <fragment version="1">
    	<require>all</require>
    	<install>
    		<delete path="${bundle.fileName}.tmp" />
    		<unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp" />
    		<copy from="${bundle.fileName}.tmp/web/nuxeo.war" to="/" />
    
    		<append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages.properties" to="nuxeo.war/WEB-INF/classes/messages.properties"
    			addNewLine="true" />
    		<append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_en.properties" 
to="nuxeo.war/WEB-INF/classes/messages_en.properties"
    			addNewLine="true" />
    
    		<delete path="${bundle.fileName}.tmp" />
    	</install>
    </fragment>

View answer in original post

2 REPLIES 2

bruce_Grant
Elite Collaborator
Elite Collaborator

Yes you need a deployment-fragment.xml in the OSGI-INF folder. It will need to be modified to meet your requirements. For example, if you have no messages.properties to append/override then remove those lines. Best to look at the Nuxeo sources for examples of what can go in the deployment fragment.

    <?xml version="1.0" encoding="UTF-8"?>
    
    <fragment version="1">
    	<require>all</require>
    	<install>
    		<delete path="${bundle.fileName}.tmp" />
    		<unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp" />
    		<copy from="${bundle.fileName}.tmp/web/nuxeo.war" to="/" />
    
    		<append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages.properties" to="nuxeo.war/WEB-INF/classes/messages.properties"
    			addNewLine="true" />
    		<append from="${bundle.fileName}.tmp/OSGI-INF/l10n/messages_en.properties" 
to="nuxeo.war/WEB-INF/classes/messages_en.properties"
    			addNewLine="true" />
    
    		<delete path="${bundle.fileName}.tmp" />
    	</install>
    </fragment>

Thanks bruce, that worked!

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.