Maven 2 and ADF

425 views
Skip to first unread message

John Stegeman

unread,
Feb 7, 2009, 12:46:12 PM2/7/09
to ADF Methodology
First of all, apologies for "hijacking" the Subversion repository
layout thread with my comments on Maven. I thought I'd start a new
thread to continue the Maven discussion.

Maven certainly has a lot to offer, but using in JDeveloper 11g has
its challenges. Is anyone using Maven for their ADF projects? If so,
do you have your own repository, and if so, how is it structured? What
do you think JDeveloper 11g needs in order to allow productive use of
Maven?

I did follow the technique on the Wiki regarding creating JWS/JPR
files from a Maven POM, and it worked just fine (I downloaded the
Trinidad source code for use as a test). Unfortunately, as I mentioned
on the other thread, a drawback was that the library definitions had a
path that was hard-coded to my personal (c:\users\jstegeman\.m2) Maven
repository, which means that the jpr files cannot really be shared
among developers, but that may be just fine, as the JWS/JPR files are
generated by the Maven plugin.

Thoughts and discussions welcomed.

John

fnimphiu

unread,
Feb 8, 2009, 1:08:59 PM2/8/09
to ADF Methodology
John,

there is a thread on OTN describing some of the requirements that
users love to see in JDeveloper.

http://forums.oracle.com/forums/thread.jspa?messageID=3250962

Maybe this is a start for your discussion. A requirement for Maven
that I get out of a project I am involved in is to provide a
repository of ADF library and their dependencies for developers who
build their deployments external to JDeveloper, to ensure they package
the correct dependency versions.

Frank

Aino

unread,
Feb 9, 2009, 2:32:33 AM2/9/09
to adf-met...@googlegroups.com

Hi,

We are very happy using use Maven for all our ADF projects. It is too bad, JDeveloper doesn't offer any support :-( so we're really lloking forward. The 'only support' is the ability to import the maven xsd and have code completion with the pom.To run maven goals from JDevel;oper we use ant build files as wrappers for maven goals to run them from JDeveloper.

The ADF libraries are stored in our central repository, managed by Nexus.The hardest challenge was to find all libraries, with version numbers. Too bad with 11g the libraries (dependencies) have changed almost completely :-(

Ciao

  Aino

John Stegeman

unread,
Feb 9, 2009, 3:34:11 AM2/9/09
to ADF Methodology
@Frank - thanks for that reference. Your stated requirement to have
the ADF libraries and their dependencies in a Maven repository is
certainly a big one - it is one of the things that is holding me back
at the moment from using Maven. I know of the ER on Metalink
requesting an Oracle-hosted repository. I also know (from opening some
JAR files) that Oracle must be internally using Maven in the ADF
Build. Would it be possible for Oracle to at least provide some
information (minimally the groupID, artifactID, version number, and
dependencies) from the Oracle internal repository? That would enable
the community to create their own repository (like @Aino has done)
while providing an easy migration if and when Oracle decides to make a
public one. It seems that there used to be a repository on
http://download.oracle.com/maven, but there isn't today.

@Aino - thanks for that note as well; your approach seems to me a
sound one. How do you keep your POM file in synch with the JPR? Do you
just update the POM and regenerate the JPR each time? Do you have any
custom archetypes for creating Fusion apps? Could you describe the
process you go through when you create a new application?

It seems that Oracle is working on some form of Maven integration
(some forum posts indicate this), but it's not clear what the
integration would entail, and the timing of it.

John

John Stegeman

unread,
Feb 9, 2009, 3:34:43 AM2/9/09
to ADF Methodology

Sandra Muller

unread,
Feb 9, 2009, 4:10:33 AM2/9/09
to ADF Methodology
We use an Artifactory repository to share jars in our team. When
running mvn, missing jars are downloaded to each team member's local
maven repository.

kind regards,
Sandra

John Stegeman

unread,
Feb 9, 2009, 7:49:47 AM2/9/09
to ADF Methodology
@Sandra - do you store the ADF jars then in your Artifcatory
repository? How did you end up classifying them (artifactid, groupid,
version, dependencies)? Do you do all of your builds in Maven? Do you
share JPR's or just POM's?

John

Aino

unread,
Feb 9, 2009, 8:42:29 AM2/9/09
to adf-met...@googlegroups.com

We keep dependencies / jars  in the jpr and the pom manually in sync. For the normal adf libs that is normally not an issue,m because they are already in the pom.External libraries, like apache commons-lang we put in a lib directory in the project that is added to subversion (and off course in the pom).

We tried using the maven-jdev-plugin, but since standardized workstation are often not an option, we can't use that (due to the relative dependencies). 

By the way, since maven 2.0.9 a new dependency scope is available : import. That allows for a central pom file with all the adf dependencies, that can easily be reused.

Currently I have not yet much experience with 11g. But I expect it not much different from 10g, except that all the libraries have changed :-( .It will take some time to identify them again.

Ciao

  Aino

Aino

unread,
Feb 9, 2009, 8:50:01 AM2/9/09
to adf-met...@googlegroups.com
We use Nexus for repository management, very nice manager. 
For classification we applied some common sense :
com.oracle.<group>.<artifact>
version (defined by properties):
adf or jdeveloper version

e.g 

  <properties>
  <jdevVersion>10.1.3.3.0</jdevVersion>
  <adfVersion>10.1.3.41.57</adfVersion>
  <jhsVersion>10.1.3.2.51</jhsVersion>
  </properties>

  <dependency>
  <groupId>com.oracle.bc4j</groupId>
  <artifactId>bc4jdatum</artifactId>
  <version>${adfVersion}</version>
  <scope>provided</scope>
  </dependency>

  <dependency>
  <groupId>com.oracle.xml</groupId>
  <artifactId>xmlparserv2</artifactId>
  <version>${jdevVersion}</version>
  <scope>provided</scope>
  </dependency>

Ciao

Sandra Muller

unread,
Feb 17, 2009, 3:10:56 AM2/17/09
to ADF Methodology
John,

On Feb 9, 1:49 pm, John Stegeman <John.Stege...@gmail.com> wrote:
> @Sandra - do you store the ADF jars then in your Artifcatory
> repository?

Yes

> How did you end up classifying them (artifactid, groupid,
> version, dependencies)?

We use the folder structure of how JDeveloper stores the jar files:
<dependency>
<groupId>JDev.modules.oracle.adf.model</groupId>
<artifactId>adfmweb</artifactId>
<version>11.1.1</version>
</dependency>
<dependency>
<groupId>JDev.adfdt</groupId>
<artifactId>adf-dt-at-rt</artifactId>
<version>11.1.1</version>
</dependency>

I like Aino's example of storing the JDev version number (11.1.1) in a
property.

> Do you do all of your builds in Maven?

No, only for deployment in nightly build and test environments and
such. During development, we build and run using the standard
JDeveloper features (library definitions in project properties,
deployment profile for running in embedded WLS).
In fact, we used maven builds for our nightly build deployment in 10g,
but have not got it working yet in 11g.

> Do you
> share JPR's or just POM's?

Both, the ADF developers all use the same JPR's for running in
embedded WLS. We agreed on a fixed folder for the project (D:\projects
\...) and a fixed location for our local Maven repositories, so that
relative or even absolute references from within the JPR work the same
for everyone.

For the ADF libraries we use the default JDeveloper libraries in the
JPR and manually create the POM entries. For jars we create ourselves
we create a Managed Library entry that refers to our local Maven
repository, and share the Managed Library xml files through Subversion
(we put them outside the JDeveloper home). We manually keep the
dependencies in synch by updating the Managed Library entries.

kind regards, Sandra

Aino

unread,
Feb 24, 2009, 8:06:31 AM2/24/09
to adf-met...@googlegroups.com

Some examples :

  <properties>
    <jdevVersion>10.1.3.3.0</jdevVersion>
    <adfVersion>10.1.3.41.57</adfVersion>
    <jhsVersion>10.1.3.2.51</jhsVersion>
  </properties>

  <dependency>
    <groupId>com.oracle.bc4j</groupId>
    <artifactId>bc4jdatum</artifactId>
    <version>${adfVersion}</version>
    <scope>provided</scope>
  </dependency>
  <dependency>

    <groupId>com.oracle.adf</groupId>
    <artifactId>adfbinding</artifactId>


    <version>${adfVersion}</version>
    <scope>provided</scope>
  </dependency>
  <dependency>

    <groupId>com.oracle.adf.faces</groupId>
    <artifactId>adf-faces-impl</artifactId>
    <version>${jdevVersion}</version>
  </dependency>
  <dependency>
    <groupId>com.oracle.jheadstart</groupId>
    <artifactId>jhsadfrt</artifactId>
    <version>${jhsVersion}</version>
  </dependency>

  <dependency>
    <groupId>com.oracle.xml</groupId>
    <artifactId>xmlparserv2</artifactId>
    <version>${jdevVersion}</version>
    <scope>provided</scope>
  </dependency>

  <dependency>
    <groupId>javax.faces</groupId>
    <artifactId>jsf-impl</artifactId>
    <version>1.1_02-b08</version>
  </dependency>

Aino

unread,
Feb 24, 2009, 8:18:32 AM2/24/09
to adf-met...@googlegroups.com

Hi

The jpr files are 'leading' and added to svn and all dependencies are added manually to the pom file.

External libraries, i.e. not included with JDeveloper are put into a lib directory (project), checked in into svn and added as project libraries .Thus all dependencies are (relative) within the project and not to the local maven repository. This allows non standard workstations and makes sure the correct libs are used. This applies to libraries like common-lang but also imported business component projects.

Thus within JDeveloper you can run the project, no maven involved.The (hourly and) nightly builds, and deployment to the development application server are done via Continuum (soon Hudson) and maven.

Aino

Chris Muir

unread,
Feb 24, 2009, 7:26:36 PM2/24/09
to ADF Methodology
As a side note to the JEE beginners on this group, there's a debate
occuring on Javalobby at the moment about Maven vs Ant as a build
tool:
http://java.dzone.com/news/maven-or-ant

...as well as further discussions on Adam Pohorecki's blog:
http://adam.pohorecki.pl/2009/02/23/the-future-of-build-tools

Hopefully useful reading to those still getting their head around the
JEE space (including me ;)

CM.

Salim OFLAZ

unread,
Feb 25, 2009, 6:37:28 AM2/25/09
to adf-met...@googlegroups.com
Hi,
I am a beginner with Maven 2, still reading documentation, I don't have
any practical experience with Maven 2 and JDeveloper in a team
environment.
@Aino,
documentation explicitly recommends putting dependent libraries in an
appropriate maven repository. It's said that at anytime you invoke maven
with -U option, all dependent libraries would be downloaded to user
local repository. In addition you can define a repository in pom.xml
file as follows;
<repository>
[...]
<snapshots>
<updatePolicy>interval:60</updatePolicy>
</snapshots>
</repository>
[...]
with this definition, any snapshot dependencies will be checked once an
hour to determine if there are updates in the remote(company-wide)
repository. So it might be the case that you had practical experiences
that leaded you to store dependent libs in subversion(?) Or you might be
talking about adf library jars in JDeveloper, which seems that there is
no maven plug-in to create this type of library(or is there?).
You mentioned that you are using Continuum and soon you will start using
Hudson. Could you please elaborate more on this? I am looking at Maestro
and according to documentation;
1. You can specify a deployment repository, so it deploys the package
after build
2. just specify the pom location, possibly from an scm
3. Ability to specify multi-module build
4. Ability to schedule a build or any maven goal(s)
5. Ability to specify multiple maven goals,and specify command line
arguments.
So what you would like to see in a maven continuous integration tool?

Best Regards,
Salim


Aino

unread,
Feb 25, 2009, 7:38:23 AM2/25/09
to adf-met...@googlegroups.com

We explicitly do not use the local maven repository from JDeveloper, because it introduces workstation dependencies and makes library manangement from a JDeveloper point-of-view less transparent.The only purpose for adding the 'external' libraries to the application (and subversion) is for use in JDeveloper without any workstation dependencies. 

Any maven executions will use the standard Maven dependency mechanism and not the libraries in the project. So we must make sure thatthe same libraries are used.

This method is not perfect, but since JDeveloper does not provide any maven support it is in our opinion the most transparent way. 

Ciao

  Aino

Reply all
Reply to author
Forward
0 new messages