The open-jbi-components module constitutes various JBI components, such as BPEL SE, used in a JBI environment. In the previous blog, I posted additional tips required for setting up the open-esb development environment on OSX. The Open ESB source tree constitutes the implementation of JBI spec.
Now going ahead on how to set up the dev environment, below steps need to be followed. The generic set of instructions are available at https://open-jbi-components.dev.java.net/public/build_instructions/ojcsetup.html and we will refer to this URL all through. Below, we mainly capture additional set up requirements or clarifications required for Mac OSX.
- Check out the src code as listed in Step 1 in the above mentioned URL.
- Set up Maven and the variables as required in Step 2. In my case, I set up my variables in .cshrc file under my home dir. One variable you would probably require to add and not mentioned in the above URL is, MAVEN_OPTS without which the build / install could throw OutOfMemory Error when processing 'axiondb' module. Over all below are the changes you will need to make to the file.
setenv JV_GFBASE /Users/me/CAPS/glassfish-v2-ur2-b04-patch-20080729
setenv JV_SRCROOT /Users/me/src/open-jbi-components
setenv MAVEN_OPTS "-Xmx512m"
alias smvn 'mvn -Dmaven.test.skip=true -Dmaven.repo.local=$JV_SRCROOT/m2/repository'
alias smvntest 'mvn -Dmaven.test.skip=false -Dmaven.repo.local=$JV_SRCROOT/m2/repository' - Now to ensure that Maven has all the required repositories, update the settings.xml file under <USER_HOME>\.m2\ directory, to ensure it has all the repositories and mirrors as shown in Step 3 on the above mentioned URL. In my case I reused by settings.xml I had put together for OpenESB environment and have copied the contents of the file at the end.
- If you need to work with some of the components as detailed out in steps 4, 5, 6, please follow as listed in the above URL. In my case I was not keen and so skipped the steps.
- Before executing the instructions in step 7 from the above URL, you need to fix the OSX JDK difference when compared to other JDK. The JBI build looks for tools.jar under JDK which in case of MAC is called classes.jar. Thanks to Russ Tremain who gave me the below steps. Since it is a one time operation, I just execute the below on my terminal window.
setenv JAVABASE /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
setenv JAVAVERS Home
setenv JAVA_HOME $JAVABASE/$JAVAVERS
cd $JAVA_HOME
sudo mkdir jre
cd jre
sudo ln -s ../bin
sudo ln -s ../lib
cd $JAVA_HOME/..
sudo ln -s Classes lib
cd lib
sudo touch tools.jar
As you observe the above creates tools.jar as required by the build. - Now go ahead and execute the instructions in step 7 of the above mentioned URL.
You are all set to contribute to the JBI source.
As always, thanks to Russ Tremain for all his inputs.
Settings.xml--------------------------------------------------------
Some of the content below may not be required, but for my environment I had all the below.
<!-- maven build properties inside SWAN -->
<settings>
<proxies>
<!-- You probably may not need this. Per Russ Tremain, the SWAN proxies are only required if you are building from outside of US Sun office. -->
<proxy>
<active>true</active>
<!-- id>testcache_http</id -->
<host>pkg.SFBay.Sun.COM</host>
<id>swan_http_proxy</id>
</proxy>
<proxy>
<active>true</active>
<protocol>https</protocol>
<host>pkg.SFBay.Sun.COM</host>
<id>swan_https_proxy</id>
</proxy>
</proxies>
<pluginGroups>
<pluginGroup>open-esb</pluginGroup>
</pluginGroups>
<mirrors>
<mirror>
<id>lsu.edu</id>
<url>http://ibiblio.lsu.edu/main/pub/packages/maven2</url>
<mirrorOf>central</mirrorOf>
<!-- United States, Louisiana -->
</mirror>
<mirror>
<id>sateh.com</id>
<url>http://maven.sateh.com/repository</url>
<mirrorOf>central</mirrorOf>
<!-- The Netherlands, Amsterdam -->
</mirror>
<mirror>
<id>ggi-project.org</id>
<url>http://ftp.ggi-project.org/pub/packages/maven2</url>
<mirrorOf>central</mirrorOf>
<!-- The Netherlands, Amsterdam -->
</mirror>
<mirror>
<id>planetmirror.com</id>
<url>http://downloads.planetmirror.com/pub/maven2</url>
<mirrorOf>central</mirrorOf>
<!-- Australia, Queensland -->
</mirror>
<mirror>
<id>dotsrc.org</id>
<url>http://mirrors.dotsrc.org/maven2</url>
<mirrorOf>central</mirrorOf>
<!-- Denmark -->
</mirror>
<mirror>
<id>ibiblio.net</id>
<url>http://www.ibiblio.net/pub/packages/maven2</url>
<mirrorOf>central</mirrorOf>
<!-- United States, North Carolina -->
</mirror>
<mirror>
<id>sunsite.dk</id>
<url>http://mirrors.sunsite.dk/maven2</url>
<mirrorOf>central</mirrorOf>
<!-- Denmark -->
</mirror>
<mirror>
<id>real-maven-snapshot</id>
<url>http://people.apache.org/maven-snapshot-repository</url>
<mirrorOf>maven-snapshots</mirrorOf>
<!-- bogus mirror to avoid redirect -->
</mirror>
<mirror>
<id>repo1</id>
<url>http://repo1.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>swan-profile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<!-- The java.net repositories may not be required. Per Russ, these are now included in common poms. -->
<repository>
<id>sun-private-repository</id>
<name>artifacts private to sun projects</name>
<url>http://iis.sfbay.sun.com/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>java-net-legacy-repository</id>
<name>java.net Maven 1.x repository</name>
<url>http://maven.sfbay/mirrors/java.net</url>
<layout>legacy</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>java-net-legacy-repository</id>
<name>java.net Maven 1.x repository</name>
<!--url>http://maven.sfbay/mirrors/java.net</url-->
<url>https://maven-repository.dev.java.net/nonav/repository</url>
<layout>legacy</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</settings>
Hi,
When I try to compile, I get following error on max. I followed all the steps defined in your article including creating tools.jar.
These are my environment variables.
JV_GFBASE=/Application/SUNWappserver
JV_SRCROOT=/Users/rohitjoshi/rjoshi-laptop/java_projects/open-esb/open-jbi-components
MAVEN_OPTS=-Xmx512m
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
JAVAVERS=Home
JAVABASE=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
/Users/rohitjoshi/rjoshi-laptop/java_projects/open-esb/open-jbi-components
bash-3.2$ smvn clean
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [clean]
[INFO] ----------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Mon Sep 22 14:46:43 EDT 2008
[INFO] Final Memory: 1M/3M
[INFO] ------------------------------------------------------------------------
Posted by Rohit on September 22, 2008 at 11:50 AM PDT #
Sorry, I was in top level directory. I am trying to compile ojc-core.
Here is the errors I get.
bash-3.2$ cd ojc-core/
bash-3.2$ smvn clean
[INFO] Scanning for projects...
Downloading: http://iis.sfbay.sun.com/maven2//open-jbi-components/global-common/1.0/global-common-1.0.pom
[WARNING] Unable to get resource 'open-jbi-components:global-common:pom:1.0' from repository sun-private-repository (http://iis.sfbay.sun.com/maven2/)
Downloading: http://maven.sfbay/mirrors/java.net/open-jbi-components/poms/global-common-1.0.pom
[WARNING] Unable to get resource 'open-jbi-components:global-common:pom:1.0' from repository java-net-legacy-repository (http://maven.sfbay/mirrors/java.net)
Downloading: http://repo1.maven.org/maven2/open-jbi-components/global-common/1.0/global-common-1.0.pom
[WARNING] Unable to get resource 'open-jbi-components:global-common:pom:1.0' from repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
GroupId: open-jbi-components
ArtifactId: global-common
Version: 1.0
Reason: Unable to download the artifact from any repository
open-jbi-components:global-common:pom:1.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
sun-private-repository (http://iis.sfbay.sun.com/maven2/),
java-net-legacy-repository (http://maven.sfbay/mirrors/java.net)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Cannot find parent: open-jbi-components:global-common for project: open-jbi-components:ojc-common:pom:1.0
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:373)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:286)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: open-jbi-components:global-common for project: open-jbi-components:ojc-common:pom:1.0
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1198)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1214)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:697)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:431)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:195)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:523)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:455)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:499)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:359)
... 11 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'open-jbi-components:global-common' not found in repository: Unable to download the artifact from any repository
open-jbi-components:global-common:pom:1.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
sun-private-repository (http://iis.sfbay.sun.com/maven2/),
java-net-legacy-repository (http://maven.sfbay/mirrors/java.net)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:528)
at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1194)
... 19 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
open-jbi-components:global-common:pom:1.0
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
sun-private-repository (http://iis.sfbay.sun.com/maven2/),
java-net-legacy-repository (http://maven.sfbay/mirrors/java.net)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:197)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:73)
at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:482)
... 20 more
Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:308)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:185)
... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Sep 22 14:51:00 EDT 2008
[INFO] Final Memory: 1M/3M
[INFO] ------------------------------------------------------------------------
When I `ls`, these directory exists.
bash-3.2$ pwd
/Users/rohitjoshi/rjoshi-laptop/java_projects/open-esb/open-jbi-components/ojc-core
bash-3.2$ ls
${maven.repo.local} component-common etlse m2 scriptse
%JV_SRCROOT%m2repository componentsl execbc mqbc sharedutilsl
CVS contrib-imola filebc msmqbc smtpbc
alese crl ftpbc nbactions.xml snmpbc
aspectse crlsl hl7bc pojose swiftbc
bpelmonitortool databasebc httpsoapbc pom.xml transformsl
bpelse dcombc iepse pom.xml~ vendor-libs
brse dtelse imsbc sandbox workflowse
build-common edmse jdbcbc sapbc wsdl4jextsl
cam emailbc jmsbc saxonsl xsltse
compileconf encodersl ldapbc schedulerse
bash-3.2$
Posted by Rohit on September 22, 2008 at 11:52 AM PDT #
Rohit,
The problem in your second post occurs since you are trying to compile at 'ojc-core' module level, while this module requires 'global-common' module which is a peer to this module.
Your first effort was right I would say. I would strongly recommend, for the first time, you build at the src root dir i.e open-jbi-components. This dir should have its own pom.xml. In case you do not, the CVS checkout failed somewhere. To compile at the src root dir, please ensure you have the settings.xml file in your $HOME\.m2 dir as shown below (step 3 in the blog)
[Samba-Pedallis-Computer:~/.m2] samba% ls
repository settings.xml
The contents for settings.xml should be the XML I posted in the blog.
Do let me know if you still have problems.
Posted by Sambasiva Pedapalli on September 22, 2008 at 12:19 PM PDT #
Hi
In case anyone is trying to build this on a MAC with NetBeans this may be useful.
Rather than put these commands in .bashrc or wherever, add them to the netbeans command file found in
/Applications/NetBeans/.../MacOS
setenv JV_GFBASE /Users/me/CAPS/glassfish-v2-ur2-b04-patch-20080729
setenv JV_SRCROOT /Users/me/src/open-jbi-components
setenv MAVEN_OPTS "-Xmx512m -Dmaven.repo.local=$JV_SRCROOT/m2/repository"
This worked for me anyway, after some hours of trying to figure it out!!!
Cheers
Russell
Posted by Russell on October 19, 2009 at 01:40 PM PDT #