facebook

Overlay [xxxxxx] is not a dependency of the project

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #325743 Reply

    Ed ross
    Member

    Create a new project
    create a simple class

    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

    
    <?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

    #325774 Reply

    support-tony
    Keymaster

    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.

    #325775 Reply

    Ed ross
    Member

    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.

    #325776 Reply

    support-tony
    Keymaster

    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.

    #326043 Reply

    Ed ross
    Member

    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?

    #326071 Reply

    support-tony
    Keymaster

    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.

    #326644 Reply

    support-tony
    Keymaster

    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.

Viewing 7 posts - 16 through 22 (of 22 total)
Reply To: Overlay [xxxxxx] is not a dependency of the project

You must be logged in to post in the forum log in