MyEclipse: Overlay [xxxxxx] is not a dependency of the project

edross - Apr 09, 2012 - 12:46 PM
Post subject: Overlay [xxxxxx] is not a dependency of the project
We are trying to upgrade to MyEclipse 10 (from 8.6) where we used some other maven plugin (we needed multi project support which the myeclipse pluging did not provide at that time).

Our project builds fine from the command line and from the old maven plugin - however, I can not get the 10.1 plugin to function quite right.

We have 7 war apps packaged into an ear. In addition, we have 1 common web app that we use as an overlay to the other 7 (all the common html, javascript, etc)

In all of the web-apps, I'm now getting the error listed in the subject (the xxx represents the name of the common war). This prevents the projects from building.

The pom is correct and builds fine from the command line.

Any idea how to correct this in MyEclipse?

thx
support-swapna - Apr 10, 2012 - 06:34 AM
Post subject:
edross,

Sorry that you are seeing this issue.

Can you answer some more questions for us?

1. Are you using Maven 3 from the command line ? MyEclipse 10 Maven support is based on Maven 3.

2. You can add and use a different Maven runtime by selecting Window > Preferences > MyEclipse > Maven4MyEclipse > Installations > Add.

3. Maven 3 is more strict and is not completely compatible with Maven 2. Take a look at this link for the compatibility notes :
https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-ParentPOMResolution

Let us know how it works for you.
edross - Apr 26, 2012 - 01:13 PM
Post subject: The command line is very different from the plug in
I'm using the same version/Installation of maven - yet
From the command line everything is fine. From the Plug-in I can build (run as mvn builld) and works fine - from eclipse, I get unresolved dependencies and pom errors. (


Code:
Description   Resource   Path   Location   Type
overlay [ id com.crowncastle:commonWeb:bin] is not a dependency of the project.   pom.xml   /businessAnalysisWeb   line 1   Maven Configuration Problem


I clearly have the dependency defined - and the overlay.


Code:
<dependencies>
      <!-- Overlay dependencies -->
      <dependency>
         <groupId>com.crowncastle</groupId>
         <artifactId>commonWeb</artifactId>
         <classifier>bin</classifier>
         <type>zip</type>
         <version>2011.1.8.0</version>
         
      </dependency>



<overlays>
   <overlay>
      <groupId>com.crowncastle</groupId>
      <artifactId>commonWeb</artifactId>
      <classifier>bin</classifier>
      <type>zip</type> 
   </overlay>
</overlays>



Also - Intermittently I will get other unresolved dependencies in my code (classpath will change when I do an update properties)

If I do a mvn eclipse:eclipse then refresh the project I only get the POM errors.

If I do it from the plugin I get unresolved dependencies. (Part of WebLogic Jar)

Code:
import javax.ejb.CreateException;

edross - Apr 26, 2012 - 02:31 PM
Post subject: Command line different from the plugin
The problem comes from the way the command line processes the dependencies vs how the plugin processes dependencies.

From the command line I get a dependency list like the second image

If done from the command line, the weblogic jar is include as a classpath entry. here, all the files referenced in the weblogic.jar META-INF/manifest classpath are added to the classpath.

When referenced from the plugin, the weblogic jar is placed inside of the "maven dependencies" which does not include the other jars which are listed in the manifest.

(VERY BIG problem with the plugin imo). This basically will make the maven plugin somewhat limited to simple projects.

Editorial comment:

I hate what weblogic did with the manifest. This has caused numerous build issues for us with outdated jars being included. However, we are kinda stuck with this for now.
support-tony - Apr 27, 2012 - 01:08 PM
Post subject:
Ed,

I'm afraid I'm not clear on what your problem is. The two partial screenshots appear to both be from MyEclipse (or eclipse), rather than one from a command line invocation and one from MyEclipse.

MyEclipse runs maven as it would be run on the command line. If you want to ensure this, you can specify your own maven installation as Swapna mentioned. Also, as she mentioned, MyEclipse 10 uses maven 3, by default, whereas 8.6 uses maven 2. You can check the version of maven by running the following command line:
Code:
mvn -version


There may be incompatibilities between maven 2 and maven 3, though I believe they can be reconciled through pom changes.

You seem to be saying that, with MyEclipse 8.6, maven is looking inside the Weblogic jar file to determine other jars to use for building. This isn't the way maven works, as all dependencies need to be specified through the pom (or the pom hierarchy). Can you provide more detail?
edross - Apr 30, 2012 - 01:35 PM
Post subject:
sorry for the confusion.

Both eclipse and the command line are pointing to the same instance of maven
C:\development\Workspace>mvn -version
Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
Maven home: C:\development\software\tools\apache-maven-3.0.3\bin\..
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_24\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows vista", version: "6.0", arch: "x86", family: "windows"
C:\development\Workspace>

The two differences from the above show what happens if

a:

I issue a mvn eclipse:eclipse or (mvn eclipse:myeclipse)

b:

I right mouse over the project and say update project configuration.


In the first case - when I include weblogic I get all of the items included in the manifest.

In the second case - when I include weblogic, i do not get the items in the manifest.

The weblogic.jar does not have a POM so there are no maven transitive dependencies.
support-tony - May 01, 2012 - 11:30 AM
Post subject:
Ed,

I managed to replicate the POM error regarding the overlay apparently not being defined as a dependency. I've raised a bug report for it. Sorry for the inconvenience though it doesn't appear to affect building.

I can't replicate the other issue about the weblogic.jar manifest classpath being included in the classpath outside of MyEclipse. I imported weblogic.jar into my local maven repository and then included it as a dependency. If I run a maven build from the command line, with the debug option, I don't see anything other than weblogic.jar being added to the classpath on the compile phase. I also don't see the extra jars in the buildpath on either MyEclipse or eclipse. Updating project configuration makes no difference in either case. I also ran "mvn eclipse:eclipse", though this should not be necessary as importing a maven project into MyEclipse effectively does the same job. However, it didn't change anything.

Would it be possible for you to create a small simple project that exhibits the weblogic.jar problem and attach it here? Or, if I've missed something that I need to do to replicate it, please explain what that is.
edross - May 01, 2012 - 11:43 AM
Post subject: WebLogic jar
I believe you are not experiencing the problem because you put the weblogic jar in the repository. This will generally not work as expected. Inside of the weblogic jar is the manifest with the following: Notice all of the of the relative classpath items. many of the jars on the classpath have a manifest that includes other jars (again relative to their location).

If you just use a repository - none of the associated jars will be found and you will encounter many errors when you need a JMS, or JTA, or WS or any weblogic specific items. (been down that path).

we have been forced to include the bea.home in our settings file.

<properties>
<ccic.snapshots.repo>http://ccicusbuild1/nexus/content/repositories/snapshots/</ccic.snapshots.repo>
<bea.home>C:/development/software/bea/bea10.3.2</bea.home>
<bea.lib>${bea.home}/wlserver_10.3/server/lib</bea.lib>
</properties>



Implementation-Title: WebLogic Server 10.3.2.0 Tue Oct 20 12:16:15 PD
T 2009 1267925
Implementation-Version: 10.3.2.0
Class-Path: ../../../modules/features/weblogic.server.modules_10.3.2.0
.jar schema/weblogic-domain-binding.jar schema/weblogic-domain-bindin
g-compatibility.jar schema/diagnostics-binding.jar schema/diagnostics
-image-binding.jar wlcipher.jar webservices.jar xmlx.jar ojdbc6.jar a
qapi.jar EccpressoAsn1.jar EccpressoCore.jar EccpressoJcae.jar mysql-
connector-java-commercial-5.0.3-bin.jar wlsqlserver.jar wldb2.jar wl
sybase.jar wlinformix.jar wlw-langx.jar ../../common/lib/pdev.jar jco
m.jar weblogic-L10N.jar
support-tony - May 01, 2012 - 12:15 PM
Post subject:
Can you explain how the bea.lib property is used in your pom, or in maven, to get weblogic.jar added to the classpath? I tried a system dependency, which worked but it only added the weblogic.jar, itself.
edross - May 01, 2012 - 12:19 PM
Post subject: Weblogic jar
We have defined a property called bea.home and bea.lib

then we use a system dependency like this

Code:
<dependency>
            <groupId>com.bea.weblogic</groupId>
            <artifactId>weblogic</artifactId>
            <version>10.3</version>
            <scope>system</scope>
            <systemPath>${bea.lib}/weblogic.jar</systemPath>
         </dependency>

edross - May 01, 2012 - 12:22 PM
Post subject: weblogic jar
you have to have installed all of the bea modules to get the other jars (not just the weblogic.jar)

Then if you use from the command line

Code:
mvn eclipse:eclipse


you will get all of the system dependencies

if you use the myEclipse update project properties you will get a different result.
support-tony - May 01, 2012 - 12:34 PM
Post subject:
Ed,

Sorry, I'm not sure what you mean by "you have to have installed all of the bea modules". I assume you don't mean installed all the module jars into the local maven repository. If you mean add a system dependency for each jar (as I did with weblogic.jar), then they should show up in the classpath, regardless of where maven is executed.
edross - May 01, 2012 - 12:37 PM
Post subject: weblogic jar
what I mean is that you will need to install weblogic on your machine. That will put all of the jars in the relative location where weblogic needs them.

then you have change your systempath to point to the weblogic lib directory where the weblogic jar is located.
support-tony - May 01, 2012 - 12:43 PM
Post subject:
Ed,

I have installed weblogic but I'm not seeing those manifest classpath files being added. I'm not sure what you mean by "systempath" but I've been trying to replicate on a Linux machine. I'll try next on a Windows machine.
support-tony - May 02, 2012 - 09:22 AM
Post subject:
Ed,

I tried on Windows XP, after installing WebLogic there and running mvn eclipse:eclipse, but couldn't get command line maven to add the jars mentioned in the weblogic.jar manifest to the classpath. However, I'm still not sure what you meant by "systempath". There is a "systemPath" element in the system dependency for weblogic.jar but this has to point to a file, not a folder. There is a "system path" in Windows, though I can't see how adding a path element for the weblogic lib folder can help (I tried it anyway, but still couldn't replicate your situation).

I'm clearly missing something here, so could you be precise in how I can replicate what you see when executing maven outside of MyEclipse? It would be helpful if you could set up a simple maven project (probably with a single simple java file for maven to compile) that constructs a classpath which includes weblogic.jar and all the jars from the manifest's classpath. Attach the project as a zip file. Also mention any environment set up that affects this.

I searched for a similar problem but the only hit I got had the answer of including all of the jars in weblogic.jar's manifest classpath entry as dependencies themselves, in the pom.
edross - May 02, 2012 - 12:09 PM
Post subject: Very simple example
Create a new project
create a simple class

Code:
package com.junk.model;

import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueBrowser;
import javax.jms.Session;
import javax.jms.TextMessage;
public class MyClass {
   
   ConnectionFactory cf;
   JMSException ex;
   Message msg;
   Queue q;
   QueueBrowser qb;
   Session ses;
   TextMessage tm;
   

}




create a simple pom.xml

Code:

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>TestClasspath</groupId>
  <artifactId>TestClasspath</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name></name>
  <description></description>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
 
  <dependency>
            <groupId>com.bea.weblogic</groupId>
            <artifactId>weblogic</artifactId>
            <version>10.3</version>
            <scope>system</scope>
            <systemPath>C:/development/software/bea/bea10.3.2/wlserver_10.3/server/lib/weblogic.jar</systemPath>
         </dependency>
   
  </dependencies>
  <build>
    <sourceDirectory>${basedir}/src</sourceDirectory>
    <outputDirectory>${basedir}/target/classes</outputDirectory>
    <resources>
      <resource>
        <directory>${basedir}/src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
   
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>



From eclipse - will not work
from command line will work

Now - from the command line mvn eclipse:eclipse

look at the classpath

from eclipse - update project configuration

look at the classpath
support-tony - May 03, 2012 - 11:02 AM
Post subject:
Ed,

Thanks for your patience. I've now managed to replicate this second error.

The confusion for me was that maven was not actually adding those extra jar files (in weblogic.jar's manifest classpath) to its classpath. However, it is the java compiler which is actually making use of the manifest classpath implicitly.

What is happening is that "mvn eclipse:eclipse" is creating a .classpath file entry for weblogic.jar directly. This gets picked up properly by the eclipse java validator, so you can see all of the related jars in the Package Explorer, under "Referenced Libraries". I couldn't actually see these extra jars in the project's build path, so I assume that your screenshot showing those jars in the build path was from an earlier release of eclipse, with later releases now changing that.

When "Update Project Configuration" is run, this remakes the project's classpath and replaces the previous weblogic.jar (and probably other jars for other dependencies) with a special container that checks the maven dependencies, with the aim of automatically picking up any dependency changes in the pom.

Unfortunately, that type of container in the classpath does not seem to behave in the same way as jar files, with respect to the eclipse Java validator, and so classes that aren't directly in weblogic.jar aren't seen. This is the same with the latest m2eclipse plug-in for regular eclipse.

I have raised a bug report for this and we may get a fix into the next release (10.5) but that can't be guaranteed as we don't know, yet, how difficult this is to fix.

I notice that this bug (and the previous Overlay bug) doesn't affect the maven build, which can be run from MyEclipse.

Sorry for the inconvenience.
edross - May 03, 2012 - 11:57 AM
Post subject: maven builds
you are correct - you can run the build, both from maven and the command line. however It is somewhat useless as eclipse show hundreds of errors in our environment, context assist will not work, and projects will not build from within eclipse.

We had used the nexus eclipse plugin before (version 8.6) but that does not seem to be available any longer.

At this time, the bug is keeping us from upgrading to 10.1. Seems ironic that a tool that was to save time has taken so much of it and become the limiting item in development.

BTW - editorial comment about maven. I have tried to upgrade our build system to gradle. However, it suffers from the same classpath issues. I will be moving OFF maven if/when gradle matures. Maven has been a huge problem in our organization causing more problems than it fixed. We have spent weeks working around the ridged structure maven imposes.
support-tony - May 03, 2012 - 12:07 PM
Post subject:
Ed,

Sorry about the problems. You're right, they are greater than I thought. I will try to ensure that the issue is addressed ASAP and see if development have any suggestions, in the meantime.
edross - May 15, 2012 - 01:55 PM
Post subject: has there been any word on this?
you were going to ask the developers if there was any work-arounds. Are there any fixes, or changes that I can make to try and build our project?
support-tony - May 16, 2012 - 04:36 AM
Post subject:
Ed,

Yes, I had a long discussion with the lead developer and there doesn't seem to be a satisfactory workaround. The bug has a high priority for fixing in the next update which may be only a few weeks away (that's a very rough estimate). However, without a fix, it's difficult to see a way round it that is fairly painless. The mvn eclipse:myeclipse command effectively adds each dependency to the classpath directly and you should not see any java errors. So the workaround is to effectively add all the dependencies to the classpath and remove the maven dependency container (via mvn eclipse:myeclipse or manually) but you'd have to avoid running the update project configuration function. If you don't change maven dependencies then this is an option for you.

Unfortunately, you can't just add weblogic.jar to the classpath because the maven dependency container is always searched first, so the extra weblogic.jar file will never be seen.
support-tony - Jun 04, 2012 - 11:01 AM
Post subject:
Ed,

Just to let you know that both of the problems you reported here will be fixed in the 10.5 release which is due out within a couple of weeks. The use of the manifest will be controlled by a MyEclipse workspace preference.
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits