Showing posts with label publish. Show all posts
Showing posts with label publish. Show all posts

Saturday, April 28, 2018

Customize maven to fetch and push to other repositories

Maven Customization

Settings.xml (Understanding)


When we install maven either there will not be any settings.xml (in .m2 folder) or the settings present in conf folder will have default settings. Hence we must first understand the importance of settings.xml file.

The first task for us is to identify where is the settings.xml in the file system for you to go and change. Either you would use maven using Sts/eclipse in which case the settings file will not be present by default. In this case you must create settings.xml file in the folder <<UserHomeDirectory>>/.m2 

If you have downloaded the maven installation then the settings.xml file would be present with default settings under for folder <<MavenHome>>/conf

Settings.xml (Explained)



<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <servers> 
        <server>
            <username>admin</username> 
            <password>Darkhorse@123</password>
            <id>remote</id>
        </server>
    </servers>
    <distributionManagement> 
        <repository>
            <id>remote</id>
            <name>Darkhorses-MacBook-Pro-4.local-releases</name>
            <url>http://192.168.50.9:8081/artifactory/dh-repo1</url>
        </repository>
    </distributionManagement>
    <profiles> 
        <profile>
            <id>dh-repo1</id>
            <repositories>
                <repository>
                    <id>remote</id>
                    <name>Darkhorses-MacBook-Pro-4.local-releases</name>
                    <url>http://192.168.50.9:8081/artifactory/dh-repo1</url>
                </repository>
            </repositories>
        </profile>
    </profiles>
    <activeProfiles> 
        <activeProfile>dh-repo1</activeProfile>
    </activeProfiles>
</settings>

Further explanation :

Servers : It stores the credentials to connect to your distributionManagement repositories.

ID : This is the identifier with which it identifies the repository of distributionManagement. You can have multiple repositories in distributionManagement tag and each repository's credentials are identified by this tag

Distribution Management : This is used basically to push/deploy the application in some other repository apart from your local one. The server where you would deploy is provided in below url tag.

Profiles :  This stores the information of multiple profiles. Each profile can have multiple repositories defined which connects to different servers.

ActiveProfiles : Settings which you can change anytime to tell maven that fetch from which repository. This is used especially in situations where you want do refer dependencies from various different servers depending on the application.

Deployment to Custom repo :

mvn deploy -DaltDeploymentRepository=remote::default::http://192.168.50.9:8081/artifactory/dh-repo1
If you want to do it from sts, below image shows how to achieve that


It requires two things,

  • Goals : Entire command without mvn.
  • User Settings : settings.xml path which will be used to fetch distributionManagement details and deploy to that repository.
I hope I am clear in explaining how to fetch and how to publish to custom repositories.

Wednesday, August 19, 2015

Command to publish jar into your local Maven Repository


D:\Kiran\Kiran\Projects\NCB\ETL>mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -Dfile=ojdbc6.jar
 -DgeneratePom=true

Points to be noted :

  • Maven client to be installed. You can check if maven is installed by running the below command ,
    mvn -version which would result in the below result,



  • Executing above command  results in below results,


Once you see the BUILD SUCCESS in the above command result,

You can add dependency in your POM.xml as below,

                <dependency>
<groupId>com.oracle</groupId> <!-- Group ID from the command-->
<artifactId>ojdbc6</artifactId>  <!-- Artifact ID from the command-->
<version>11.2.0.3</version>       <!-- Version from the command-->
</dependency>

References :


Tuesday, October 14, 2014

Publishing the content is ever lasting

Sometimes a possible situation arises when publishing takes ever longing time. This is identified to be due to BPMs in the project as every publish will have an entry for PSL (Published Source Layer). This can be solved by adding a property for cws config

 development.publish.to.psl.enabled=false

------------------------------------------------------------------------------------------
Below is the history behind this problem

Problem

Publishing business processes seems to take ever more time.

Reason

In the Process Instance Manager (PIM) and from the Inbox you have the option to graphical view the progress definition of the process instance. For every publish of a business process, the design time information is stored in a Published Source Layer (PSL). Each process instance refers to a PSL and in this way we know which version of the process definition belongs to the instance. On every publish of a business process, a new PSL is created. Due to some performance issues, this takes ever more time.

Solution

The best solution is to solve the performance issues. For the meantime there are two alternatives:

Processor settings

In case you don’t need to view all versions of the business process from the Process Instance Manager while developing, you can disable publishing to PSL. This can be achieved by:

putting the following line in cws.properties (in install dir\components\cws\config):
development.publish.to.psl.enabled=false
restart the CWS processor
Please note that this setting applies to this whole Cordys installation, not only your current workspace.

Fresh organization

In case you do need the runtime versioning of the business process from the Process Instance Manager, there is a workaround by regularly moving to another organization, as PSLs are isolated per organization.

Applies to

Cordys BOP-4 GA, and all it's CU's

Monday, February 10, 2014

One Problem of having CWS and ISVP in a single Environment

Scenario:

 This post is about the problem I have faced by having the CWS content and ISVP content only in one single environment. I have one project's CWS content and ISVP content in my local environment. Now what I did was, I have uninstalled the isvp from my local machine. The UnInstallation was successful but however both the CWS content and ISVP content in the same environment will be sharing common cordys database, while uninstalling the ISVP it removed certain content from the cordys database (Assumable its xsd related content). The process of uninstallation was successful. But now I am facing a problem from my development content. When i publish any of the newly created web service it doesn't succeed throwing the exception which is shown below,

<![CDATA[ApplicationTransaction 'com.cordys.cap.applicationconnector.Transaction' threw an exception during abort.]]></log4j:message>
<log4j:NDC><![CDATA[Running Publishing document(s)
 Publishing HealthMonitoringTool/Web Services/HealthMonitor/ESB-App/Composite/HealthMonitor.ESBApp.Composite.ESBAppCompositeWS
 Publishing HealthMonitoringTool/Web Services/HealthMonitor/ESB-App/Composite/HealthMonitor.ESBApp.Composite.ESBAppCompositeWS/ESBAppCompositeWSI
 Publishing HealthMonitoringTool/Web Services/HealthMonitor/ESB-App/Composite/HealthMonitor.ESBApp.Composite.ESBAppCompositeWS/ESBAppCompositeWSI/GetDistintOrgsFromConfiguration
 Publishing HealthMonitoringTool/Web Services/HealthMonitor/ESB-App/Composite/HealthMonitor.ESBApp.Composite.ESBAppCompositeWS/ESBAppCompositeWSI/GetDistintOrgsFromConfiguration/GetDistintOrgsFromConfigurationRealization
 Publishing HealthMonitoringTool/Ws-App Packages/HealthMonitor/HealthMonitorAppR1
 Publishing HealthMonitoringTool/Ws-App Packages/HealthMonitor/HealthMonitorAppR1/COMM_JOBRUN_WORKITEM_DETAILS.xsd
 Publishing HealthMonitoringTool/Ws-App Packages/HealthMonitor/HealthMonitorAppR1/COMM_JOBRUN_WORKITEM_DETAILS.xsd/Reference_to_00505687-00BD-11E3-E8EE-2679912CB788
 Publishing HealthMonitoringTool/Ws-App Packages/HealthMonitor/HealthMonitorAppR1/XMLSchema_Binary_Reference_WSAppServerSchema.xsd
]]

I have understood that I created a mess first by having both cws and ISVP content in one single environment and second by unInstalling isvp. I have installed the isvp again in the environment and tried publishing the newly created web service. But NO LUCK :( still I have the same issue. This issue got resolved when I restarted the cordys monitor and then tried publishing the service. 

The situation is same for any newly created web service in this scenario. Whenever I create a new web service in my local development server, in order to publish it successfully I have to restart cordys monitor and then try publishing.

Note : I could able to find the resolution, but I wasn't able to understand what exactly went wrong. People can put their thoughts on this and let me know if they have found the reason behind this by giving a clear explanation.

Wednesday, January 15, 2014

Unable to publish the Project

Hi All,
 
      We are getting following error in cordys while publishing the project in Dev server.
Let us know if any one have idea on this issue.

Error details: 
The "UpdateSearchableAttributes" request did not process successfully because of "<update reply="no"><tuple><new><NOTIFICATION_SEARCH_COLRUNNING><SEARCH_TYPE_ID>005056A1-0084-11E1-FD73-9F4E9CB693E9</SEARCH_TYPE_ID><DATATYPE>STRING</DATATYPE><AVAILABLE_COLUMN>1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25</AVAILABLE_COLUMN></NOTIFICATION_SEARCH_COLRUNNING></new><error TYPE="Enumeration"><elem>Error :java.sql.SQLException: ORA-00001: unique constraint (CAPS2NEW.NSCR_PK) violated
</elem></error></tuple></update>".

at com.cordys.cws.internal.client.SoapClientBase.convertSOAPFaultToException(SoapClientBase.java:293)
at com.cordys.cws.internal.client.SoapClientBase.sendRequest(SoapClientBase.java:106)
at com.cordys.cws.internal.client.SoapClientBase.sendRequest(SoapClientBase.java:71)
at com.cordys.cws.internal.client.SoapClientBase.sendRequest(SoapClientBase.java:153)
at com.cordys.workflow.modeler.WorkflowSoapClient.execute(DeployWorkFlowDeliveryModel.java:209)
at com.cordys.workflow.modeler.DeployBuildWorkFlowDeliveryModelTask.execute(DeployWorkFlowDeliveryModel.java:135)
at com.cordys.cws.tasks.StudioTaskHelper.executeTask(StudioTaskHelper.java:50)
at com.cordys.cws.tasks.StudioTaskHelper.executeTasks(StudioTaskHelper.java:63)
at com.cordys.cws.tasks.StudioTaskHelper.executeTasks(StudioTaskHelper.java:71)
at com.cordys.cws.internal.deploy.DeployEngine.deployDocument(DeployEngine.java:666)
at com.cordys.cws.internal.deploy.DeployEngine.deployDependencyBox(DeployEngine.java:993)
at com.cordys.cws.internal.deploy.DeployEngine.deployDocument(DeployEngine.java:654)
at com.cordys.cws.internal.deploy.DeployEngine.deployDocument(DeployEngine.java:718)
at com.cordys.cws.internal.deploy.DeployEngine.deployDependencyBox(DeployEngine.java:993)
at com.cordys.cws.internal.deploy.DeployEngine.deployDocument(DeployEngine.java:703)
at com.cordys.cws.internal.deploy.DeployEngine.deployDocument(DeployEngine.java:718)
at com.cordys.cws.internal.deploy.DeployEngine.deployDocument(DeployEngine.java:718)
at com.cordys.cws.internal.deploy.DeployEngine.deployDocument(DeployEngine.java:718)
at com.cordys.cws.internal.deploy.DeployEngine.deployDocument(DeployEngine.java:147)
at com.cordys.cws.deploy.Deployer.doOperation(Deployer.java:180)
at com.cordys.cws.internal.operation.OperationBase.execute(OperationBase.java:110)
at com.cordys.cws.internal.operation.CompositeOperation.doOperation(CompositeOperation.java:64)
at com.cordys.cws.internal.operation.OperationBase.execute(OperationBase.java:110)
at com.cordys.cws.internal.operation.runner.OperationRunner$AsynchronousOperationRunner$AsyncBrokerOperation.execute(OperationRunner.java:295)
at com.cordys.cws.internal.operation.broker.BrokerServerOperationThread.runOperation(BrokerServerOperationThread.java:74)
at com.cordys.cws.internal.operation.pool.CustomOperationThread.run(CustomOperationThread.java:206)

-- Harish Munaga DH
------------------------------------------------------------------------------------------------------------------------------------------------
Hi All,
     I searched in the cordys db for "NOTIFICATION_SEARCH_COLRUNNING" table and i found out the record. Please check it in below
  Present cordys db details:
SEARCH_TYPE_ID=005056A1-0084-11E1-FD73-9F4E9CB693E9
DATATYPE=STRING
AVAILABLE_COLUMN=6,13,14,16,17,24,8,20,2,3,18,5,23,7,25,9,4,11,12,2,3,18,5,23,20,7,25,9,4,11,12,22,15,19,8,10,21,1,2,3,18,5,23,20,7,25,9,4,11,12,22,15,19,8,10,21,1,1,22,15,19,8,10,21,20,2,3,18,5,23,7,25
I don't know what to do in order to resolve this issue.If any one know this issue let us know ASAP.
-- Harish Munaga DH
-------------------------------------------------------------------------------------------------------------------------------------------------
Hi Amit,
No we have not changed anything in the cordys Dattabase,
We just republish the project folder by folder and then the complete project.

-- Rajneet Patel
--------------------------------------------------------------------------------------------------------------------------------------------------