facebook

7.0.1 ignoring "provided" scope when deploying to

  1. MyEclipse IDE
  2.  > 
  3. Maven for MyEclipse (Maven4MyEclipse)
Viewing 15 posts - 1 through 15 (of 37 total)
  • Author
    Posts
  • #293285 Reply

    aposso
    Member

    Hi!

    Myeclipse 7.0.1 on linux is ignoring <scope>provided</scope> directives in dependencies when deploying to a server, e.g. container provided jar’s are copied to WEB-INF/lib. This applies to packaged as well as exploded mode. When exporting the project to .war, the provided scope is honored.

    Is there a workaround other then deploying manually or deleting the offending jar’s from WEB-INF/lib by hand?

    Thanks, regards,
    Thorsten

    #293286 Reply

    aposso
    Member

    … and this forum is silently cutting the subject line to 50 chars. Some would think it good practice to not allow more then 50 chars being entered instead of just throwing away user input. 😉

    #293344 Reply

    scallaer
    Member

    You are not the only one having this issue.

    #294191 Reply

    denis.zjukow
    Member

    I am having this problem either. Does anyone know a workaround?

    #294245 Reply

    Can you tell me what Jars exactly get deployed this way? Note: MyEclipse will deploy JSF jars to Tomcat since otherwise an application will not work.

    My test:
    1. Added

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
    </dependency>

    Log4J jar is deployed.

    2. Added:

    <scope>provided</scope>

    The jar is not deployed, as expected.

    #294316 Reply

    denis.zjukow
    Member

    Hello, Eugene.

    You are right in your example everything works fine. However, the problem still exists. These are the steps how to reproduce it:

    1. Create a new Java Maven Project named say “UtilityProject”. Leave default values provided by wizard.
    2. Open pom.xml of the created UtilityProject and ensure that it has the following “coordinates”:

                <groupId>UtilityProject</groupId>
                <artifactId>UtilityProject</artifactId>
                <version>0.0.1-SNAPSHOT</version>
    

    3. Create a Web Project with Maven support named “WebProject”.
    4. Open pom.xml of the WebProject and add our UtilityProject as a dependency with node scope set to “provided”:

            <dependency>
                <groupId>UtilityProject</groupId>
                <artifactId>UtilityProject</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
    

    5. Deploy the WebProject on the server. I tried both Tomcat and JBoss AS. The result is the same, the WebProject’s WEB-INF/lib folder contains a file with name utilityproject_classes.jar.

    P.S. I tried this example on Windows XP and Linux Ubuntu. I managed to reproduce the problem in both cases.

    #294380 Reply

    allenparslow
    Member

    I can’t reproduce the problem either under MyEclipse Build id: 7.0-20081201.

    But, here are some tips I’ve found when troubleshooting scope-provided dependencies:

    Have you done a clean from the project menu, followed by a redeploy?

    Does mvn dependency:tree list the scope as provided (i.e. has another dependency overriden your scope) or even better what does “mvn install” have in the war’s WEB-INF folder?

    Have you remove all files from [PROJECT]\WebRoot\WEB-INF\lib (or src/main/webapp)? (the project WEB-INF\lib, not the one on tomcat)

    Alternatively, is there a “Referenced Libraries” build-path container visible.

    Under the source tab in the java-build path (of the project properties), if it says the output folder is target/classes, then you need to re-import your project (usual causes are updating the project configuration [directly or indirectly] or have a invalid pom configuration [e.g. missing <packaging>war</packaging>].

    #294381 Reply

    allenparslow
    Member

    There is always the workaround of using “mvn clean install” from the command line (outputs to the target folder of your project). If that is having the same problem, then the artifact jar is your project’s WEB-INF\lib.

    #294396 Reply

    Riyad Kalla
    Member

    Denis, what was the result of trying Allen’s workaround?

    (btw Allen, thank you for helping out!)

    #294769 Reply

    denis.zjukow
    Member

    Hey, thanks for help. Sorry for the delay. I’ve been trying to install MyEclispe 7.0 (I am having some problems with Pulse). It turned out that I used MyEclipse 6.6 when post my reply on this thread. I will try what Allen suggested as soon as I get MyEclipse 7.0 installed.

    #294836 Reply

    denis.zjukow
    Member

    Well, don’t want to be annoying, but I still have an “UNEXPECTED JAR FILE” in the WEB-INF/lib folder of the packaged by MyEclipse 7.0 war file (despite the fact that this UNEXPECTED JAR FILE corresponds to a dependency with scope “provided”).
    Allen, thanks for your tips. These are the answers for your questions:

    Have you done a clean from the project menu, followed by a redeploy?

    Yes, I have cleaned all the project before redeploying.

    Does mvn dependency:tree list the scope as provided (i.e. has another dependency overriden your scope) or even better what does “mvn install” have in the war’s WEB-INF folder?

    Yes, mvn dependency:tree lists the dependency as “provided”.

    Have you remove all files from [PROJECT]\WebRoot\WEB-INF\lib (or src/main/webapp)? (the project WEB-INF\lib, not the one on tomcat)

    My “[WEB_PROJECT]/WebRoot/WEB-INF/lib” is empty.

    Alternatively, is there a “Referenced Libraries” build-path container visible.

    The WEB project does not have “Referenced Libraries”. It only has “JRE System Library” and “Maven Dependencies”.

    Under the source tab in the java-build path (of the project properties), if it says the output folder is target/classes, then you need to re-import your project (usual causes are updating the project configuration [directly or indirectly] or have a invalid pom configuration [e.g. missing <packaging>war</packaging>.

    The output folder of my WEB project is “[WEB_PROJECT]/WebRoot/WEB-INF/classes”. The pom.xml file has <packaging>war</packaging> defined.

    I now use MyEclipse 7.0 (build 7.0-20081201), but as you can see still have exactly the same problem. What I am doing wrong? Any ideas?

    #294838 Reply

    denis.zjukow
    Member

    One more thing… I also want to mention that if I package the WAR file manually (i.e mvn clean package) everything works fine — no “provided” dependencies in the lib folder (i.e expected behavior).

    #294883 Reply

    Riyad Kalla
    Member

    Denis,

    Is it possible for you to share this project with us so we can pull it into our dev environment and step right through the code that is getting triggered and see what is going on?

    #294898 Reply

    denis.zjukow
    Member

    Absolutely, how can I do that? I might send the whole workspace through email for example. Can you please tell me where to send it to?

    #294944 Reply

    denis.zjukow
    Member

    Riyad,

    Please provide me with your email address so I could send you my project as you asked.

    Thank you!

    P.S. By the way, just to let you know, myeclipseide.com had been unavailable for a couple of hours today.

Viewing 15 posts - 1 through 15 (of 37 total)
Reply To: 7.0.1 ignoring "provided" scope when deploying to

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