WSO2MB doesnot work in spring boot - wso2

I am trying to use WSO2MB in spring boot, but the maven is not able to download the dependencies like andes-client-3.1.1.jar.
It is working fine when I use msf4j. Is it not possible for spring-boot to use wso2mb?
I am getting error:
Failure to find org.wso2.andes.wso2:andes-client:jar:0.13.wso2v10 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
Thanks

Those artifacts are not synced with the maven central. You can add the wso2 nexus as a repository in the pom.
http://maven.wso2.org/nexus/content/repositories/releases/

Related

Nexus 3.5.1 proxies from snapshot repo nothing but maven metadata files

I have upgraded nexus repository from 2.x to 3.x through following path:
2.4.14 -> 3.4.0 -> 3.5.1
All nexus services were packed in docker with data directory mapped from host's. For all services I use default either sonatype/nexus or sonatype/nexus3 containers. Nexus web interface is hidden behind nginx with simple reverse proxying.
I use the nexus service with boot-cj (with no credentials) tools which manages dependencies the same way as maven. Anyway the tool first downloads nexus-maven.xml with relevant sha1 files and tries to download jars. It works fine with all 2.x I had.
I created a proxy repository against remote sonatype-snapshots repo. When I start compilation I have Could not find artifact error. I found that the meatdata files are cached but all poms and jars.
I have tried to fix it by cleaning cache with the clean_cache file trick and more rough rm -rfv /srv/nexus3/nexus-data/cache/* with no success. There are no any logs about error. Also I have checked manually that required artefact exists in the remote repository. More obvious Rebuild index button gave no solution. I do not thing it is a problem with nginx, but who knows? Also leaving overnight to run the scheduled tasks did not help.
The expected artifact is org.eclipse.rdf4j:rdf4j:pom:2.3-20170901.145510-11.

wso2 carbon: how to hack the source and deploy the changes to a carbon server

I have the carbon source tree set up in eclipse - and have made some code changes.
Can I build just one component (e.g. org.wso2.carbon.feature.mgt.ui-4.1.0.jar) using maven / eclipse, and then deploy that to an existing carbon server?
I have tried dropping the built jar in the repository\deployment directory and restarting the server, but the changes don't appear to have been picked up.
Am I doing something wrong?
Place the jars at <CARBON_HOME>/repository/components/plugins. Also delete the relevant existing jars from repository/components/plugins

How could I automate build deploy in jenkins?

We are using jenkins for CI. we get late night builds. Is there any way to automate the build deploy as soon as we get a mail or intimation ? Any suggestions would be appreciated..
One mechanism to deploy off of a build on Jenkins is to use artifacts to place the latest binary in a known location, and then kick off a new job (only on success of the compile/test phase) which uses (private key protected) ssh or scp to copy the artifacts to the test/production machine and then perform the install.
We use a similar mechanism for some automated testing that we do. The tricky part is getting the shell command to handle the ssh keys, so we do the following:
eval `ssh-agent -s`
ssh-add ~/.ssh/your_private_key_here
As long as that private key is on the Jenkins server and the public key is on the server you're trying to push to, you can then use ssh and scp commands in the rest of the script to perform functions on the server in question.
If you prefer to run the process entirely from the target server end, you can create a small script that runs on the server that checks for new files in the artifact directory of your Jenkins server build. Thanks to the latest path, you don't have to know the build number to do this. To find the specific path, you can log in to your Jenkins server (once you've saved at least one artifact), and find the project you are using and look at the Last Successful Artifacts, which will be URLs to the last successful builds of the artifacts. These URLs remain constant and always point at the most recent successful build, so you don't have to worry about them changing unless the project name or server name changes.
NOTE: there are security holes here that you can drive a truck through if you are doing this for anything other than a deployment to test. In the case of the first mechanism, your build server has an ssh key that gives it access (potentially destructive) to the target. In the case of the second mechanism, you are trusting that the Jenkins server will only serve up binaries that are good for you. However, for test environments, push to stage, etc. these techniques will work well.
These are the ways I know:
With a script:
In the Jenkins configurations, you can execute windows/shell commands after the execution of your maven goals. In my case, I have a Glassfish on a Linux, and via ssh I execute the asadmin parameters for the deployment. I have installed an instance in the server, and the process that I follow is: stop instance, undeploy app, deploy app, start instance (commands).
With a Maven Deploy Plugin:
This plugin takes a war/ear file and deploys that to a running remote application server at the end of a build. The list of currently supported containers include:
Tomcat 4.x/5.x/6.x/7.x
JBoss 3.x/4.x
Glassfish 2.x/3.x
https://wiki.jenkins-ci.org/display/JENKINS/Deploy+Plugin
With Cargo:
The Deploy Plugin is based on this. You must edit your pom.xml and execute the goals of deploy with maven.
http://cargo.codehaus.org/
In tomcat, configuration with jenkins and tomcat:
Install and download the jenkins on your server and start the server go to jenkins portal after that create the project using 'New Item' and select the pom.xml and create the maven project.
Now go to your project and click on Configure and select the "Restrict where this project can be run" and add master in your Level Expression.
select the "Source Code Management" clisck on git and configure your git repository and credential and branch name.
Select the "Build" add Root pom : pom.xml and Goals and options : clean install -DskipTests
select the "Post-build Actions" and select the "Deploy war/ear to a container"
WAR/EAR files : target/test.war
Context path : test
Containers select tomcat and add Credentials
Tomcat URL : example : http://localhost:8080/
Update the 'apache-tomcat-8.5.5\webapps\manager\META-INF\context.xlm file. uncomment the Value tag. and restart server
context.xml file
Before :
<Context antiResourceLocking="false" privileged="true">
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
allow="192\.168\.0\.9|127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
</Context>
After change :
<Context antiResourceLocking="false" privileged="true" >
</Context>
for auto deployment: go to 'apache-tomcat-8.5.5\conf\context.xml' and add antiResourceLocking="true" in 'Context' tag

Build dashboard

Is there a build dashboard somewhere for the different carbon/wso2 releases?
I just checked out the 4.0.3 tag of carbon ( https://svn.wso2.org/repos/wso2/carbon/platform/tags/4.0.3)
and I was assuming tags are stable. But the build failed with the following error
The project org.wso2.carbon:SecVerifier:4.0.0
(/wso2/4.0.3/products/integration/security-verifier/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find
org.wso2.carbon:integration:pom:4.0.0 in http://people.apache.org/repo/m2-incubating
repository was cached in the local repository, resolution will not be reattempted until
the update interval of apache-incubating has elapsed or updates are forced and
'parent.relativePath' points at wrong local POM # line 22, column 13 -> [Help 2]
Are these tags stable? I am using Maven 3.0.5 and Java 1.6
WSO2 build status dashboard can be found with continuous build too, Bamboo.
If you are trying to build something on a released branch, the easiest would be to build only that component, as for released versions, we have published maven repos with build artifacts.

Tapestry webapp with embedded Jetty

How can I configure a Tapestry5 project to run standalone (via java -jar) with embedded Jetty?
I'm looking for a short "recipe" regarding Tapestry5, Jetty, configuration of servlets/ handlers/ whatever is needed to connect the dots...
I've seen a few dots: How to Create an Executable War, Configuring Tapestry (ref Tapestry as servlet filter)
Edit: I'm thinking about a standalone running webapp due to server circumstances. It doesn't have to be embedded Jetty, but I can't rely on a stable appserver. Still looking for a recipe, though, so I don't spend much time on dead ends...
Also, I'd like for Jenkins (Hudson) to be able to stop and start the server automatically when deploying updates - I don't know if that influences what I can do with Jetty, f.ex.
Well, i believe this is a general "how to run a war question". Assuming you indeed have a war, you can use jetty or winstone to "run" it - see :
http://winstone.sourceforge.net
and
http://www.enavigo.com/2008/08/29/deploying-a-web-application-to-jetty/
In the first case, you can directly do
java -jar winstone.jar --warfile=<warfile>
https://github.com/ccordenier/tapestry5-hotel-booking/
<-- Check its maven build
http://tapestry.zones.apache.org:8180/tapestry5-hotel-booking/signin
I did some digging, and this is the short recipe I basically ended up following:
Start with the Maven Jetty plugin as configured in the pom.xml of the Tapestry 5 archetype
Add the stopKey and stopPort attribute to Maven Jetty plugin configuration
Let Jenkins CI run maven target jetty:stop and then clean install
Let Jenkins run shell script mvn jetty:run &
Voila - my Java app is up and running with automatically updated code, without any appserver.