Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven provided scope deployed on Juno + Tomcat 7
    text
    copied!<p>Perhaps not a Maven issue then. m2e / wtp issue, maybe? </p> <p>Just to give a background, I set up an ICEFaces project in Eclipse and deployed it in Tomcat 7.0.30. It appears the Maven POM configuration for servlet-api.jar to be in provided scope is disregarded while deploying to Tomcat. Am I missing anything? How do I get Maven to do it right?</p> <p>In the project <strong>javax.servlet-api.jar</strong> is pulled in as a transitive dependency of ICEFaces. Since Tomcat comes with it's own servlet-api.jar I marked it to be excluded and added an explicit dependency (scope:provided).</p> <blockquote> <p>INFO: Starting Servlet Engine: Apache Tomcat/7.0.30<br> 06-Mar-2013 10:44:05 org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(D:\workspaces\test-project\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\test-project\WEB-INF\lib\javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class<br> 06-Mar-2013 10:44:07 com.sun.faces.config.ConfigureListener contextInitialized</p> </blockquote> <p><strong>Maven POM</strong></p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;org.icefaces&lt;/groupId&gt; &lt;artifactId&gt;icefaces-ace&lt;/artifactId&gt; &lt;version&gt;3.2.0&lt;/version&gt; &lt;exclusions&gt; &lt;exclusion&gt; &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt; &lt;groupId&gt;javax.servlet&lt;/groupId&gt; &lt;/exclusion&gt; &lt;/exclusions&gt; &lt;/dependency&gt; And added a dependency with provided scope &lt;dependency&gt; &lt;groupId&gt;javax.servlet&lt;/groupId&gt; &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt; &lt;version&gt;3.0.1&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; </code></pre> <p>Setup:<br> * Eclipse Juno<br> * Maven webapp project was created.<br> * JSF and ICEFaces facets were enabled and configured.<br> * Configured the Eclipse project's Deployment Assembly to deploy Maven dependencies.<br> * Deploying the project to Tomcat from Eclipse (Right click in servers tab> Add/Remove > add the project > Publsh)</p> <p><strong>* Update 1 *</strong></p> <p><strong>mvn dependency:tree -Dverbose</strong></p> <p>Don't know what to do about these warnings. I'll look up on how to enable debug logging.</p> <pre><code>[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building test-project Maven Webapp 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ test-project --- [WARNING] The POM for org.codehaus.plexus:plexus-utils:jar:1.0.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for classworlds:classworlds:jar:1.1-alpha-2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.apache.maven:maven-plugin-api:jar:2.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.apache.maven:maven-model:jar:2.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [WARNING] The POM for org.apache.maven:maven-settings:jar:2.0 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details [INFO] com.mochapenguin:test-project:war:0.0.1-SNAPSHOT [INFO] +- junit:junit:jar:3.8.1:test [INFO] +- org.icefaces:icefaces-ace:jar:3.2.0:compile [INFO] | \- org.icefaces:icefaces:jar:3.2.0:compile [INFO] | +- org.glassfish:javax.faces:jar:2.1.6:compile [INFO] | +- javax.portlet:portlet-api:jar:2.0:compile [INFO] | +- org.icepush:icepush:jar:3.2.0:compile [INFO] | | \- javax.mail:mail:jar:1.4.1:compile [INFO] | | \- javax.activation:activation:jar:1.1:compile [INFO] | \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.12:compile [INFO] +- org.icefaces:icefaces-compat:jar:3.2.0:compile [INFO] | +- (org.icefaces:icefaces:jar:3.2.0:compile - omitted for duplicate) [INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.0:compile [INFO] | +- commons-logging:commons-logging:jar:1.1:compile [INFO] | \- javax.servlet:jstl:jar:1.2:compile [INFO] \- javax.servlet:javax.servlet-api:jar:3.0.1:provided [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.440s [INFO] Finished at: Wed Mar 06 13:24:47 GMT 2013 [INFO] Final Memory: 6M/120M [INFO] ------------------------------------------------------------------------ </code></pre> <p><strong>* Update 2 *</strong></p> <p>I had the following version installed in Juno:</p> <pre><code>m2e - Maven Integration for Eclipse 1.3.0.**20130129-0926** org.eclipse.m2e.feature.feature.group Eclipse.org - m2e </code></pre> <p>Added the link in the answer on the post pointed to by @eis Did a Check for updates. Eclipse showed there was a minor update available (<strong>1.3.1.20130219-1424</strong>). But the update failed with the following error:</p> <pre><code>An error occurred while collecting items to be installed session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). No repository found containing: osgi.bundle,com.ning.async-http-client,1.6.5.20130219-0923 No repository found containing: osgi.bundle,org.eclipse.m2e.archetype.common,1.3.1.20130219-0923 No repository found containing: osgi.bundle,org.eclipse.m2e.core,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.core.ui,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.discovery,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.editor,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.editor.xml,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.jdt,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.launching,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.lifecyclemapping.defaults,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.maven.indexer,1.3.1.20130219-0923 No repository found containing: osgi.bundle,org.eclipse.m2e.maven.runtime,1.3.1.20130219-0923 No repository found containing: osgi.bundle,org.eclipse.m2e.model.edit,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.refactoring,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.eclipse.m2e.scm,1.3.1.20130219-1424 No repository found containing: osgi.bundle,org.jboss.netty,3.2.5.Final-20130219-0923 No repository found containing: org.eclipse.update.feature,org.eclipse.m2e.feature,1.3.1.20130219-1424 </code></pre> <p>So, I uninstalled the existing m2e and reinstalled it. This worked. Also included </p> <pre><code>m2e - slf4j over logback logging (Optional) 1.3.1.20130219-1424 org.eclipse.m2e.logback.feature.feature.group Eclipse.org - m2e </code></pre> <p>But the issue remains. Juno is still deploying javax.servlet-api3.0.1.jar :(</p> <hr> <h3>Solved</h3> <p>(Disclaimer first: This is my understanding. Happy to be corrected)</p> <p>It appears m2e + m2e extras (not sure if they are separate entities still, or just m2e) was already installed with Juno. I had to install <a href="http://www.eclipse.org/m2e-wtp/" rel="nofollow noreferrer">m2e - wtp connector</a> for things to work properly. Maven scopes are now honoured.</p> <p>Install m2e-wtp connector: In Juno - Window > Preferences > Maven > Discovery > Open Catalog > Select the check box against m2e-wtp connector to install it. This adds the following to the installed software</p> <pre><code>m2e-wtp - Maven Integration for WTP (Incubation) 0.17.0.20130212-1821 org.eclipse.m2e.wtp.feature.feature.group Eclipse.org - m2e-wtp </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload