You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Yucca Nel <yu...@live.co.za> on 2011/05/28 15:29:04 UTC

Strange potential bug Maven2?

Hello I am having an issue using the following setup:

IDEA 9.03
JDK 6.0.24
Maven 2
Tomcat 7.05

Basically I create a pom project for the sole purpose as a plugin dependency for my faces 2 (I plan on having 2 different such projects for JEE and plain servlet containers respectively.
I am running a sample project successfully using the following pom from the CLI (command: mvn package tomcat:deploy) with my project configured to use a local tomcat instance.
At this point everything works, but removing/refactoring the following:

========================================================
<dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
=======================================================

From:
========================================================
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.jarbar.the</groupId>
    <artifactId>Jerel-Baker</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Jerel-Baker</name>
    <url>http://thejarbar.org/JerelBaker</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        
        <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
    </dependencies>
    <build>
        <finalName>Jerel-Baker</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>tomcat-maven-plugin</artifactId>
                    <configuration>
                        <url>http://localhost:8080/manager/text</url>
                        <server>local_tomcat</server>
                        <path>/${project.build.finalName}</path>
                    </configuration>                   
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.1</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
===========================================================
Into it’s own pom project and then installing it to local repo and then including that pom project as a depandancy,
causes failure when accessing the project in browser.

Something along the lines of duplicate TLD, but this tomcat it seems!

I look at my WEB-INF/lib and I see duplicate jsf-api and jsf-impl jars which I suspect is causing this. 
Is there a reason why I am getting these duplicate jars that don’t match(versions)?

Another thing that is worth noting is that the FacesServlet is not found in classpath as is evident in IDEA but I am using exact same dependencies and only putting them into own pom project!
Is it IDEA or maven?

I can do a youtube video if this is not clear....

Re: Strange potential bug Maven2?

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 29 May 2011 04:11, Yucca Nel <yu...@live.co.za> wrote:
> I refactored the dependency into a dependency management(all my
> dependencies), but I note that there is still going to be RException for the
> Faces Servlet as my IDE is already complaining that the Class is missing.
> It's no problem though as I can just revert to what works, but would be nice
> to have my own Majorra pom and an alternate MyFaces pom for the different
> types of containers.
>
> Please inform (if you can) if this is an IDE or Maven issue?

Just to be clear, having the dependency in your dependency management
section is not enough. You still need to list it in your dependencies.
Did you read the link I sent?

(If you did then I don't know why it's not working.)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Strange potential bug Maven2?

Posted by Yucca Nel <yu...@live.co.za>.
I refactored the dependency into a dependency management(all my 
dependencies), but I note that there is still going to be RException for the 
Faces Servlet as my IDE is already complaining that the Class is missing.
It's no problem though as I can just revert to what works, but would be nice 
to have my own Majorra pom and an alternate MyFaces pom for the different 
types of containers.

Please inform (if you can) if this is an IDE or Maven issue?

-----Original Message----- 
From: Yucca Nel
Sent: Sunday, May 29, 2011 12:45 PM
To: Maven Users List
Subject: Re: Strange potential bug Maven2?

Many thanks. I am reading a oreilly Sonatype Maven and such valuable info
not included :D

-----Original Message----- 
From: Hilco Wijbenga
Sent: Saturday, May 28, 2011 9:57 PM
To: Maven Users List
Subject: Re: Strange potential bug Maven2?

On 28 May 2011 07:09, Yucca Nel <yu...@live.co.za> wrote:
> Sorry, I will try be clearer... this:
> ================================
> <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-api</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-impl</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
> ====================================
> Is not the same as this:
> ====================================
> <dependency>
>           <groupId>org.thejarbar</groupId>
>           <artifactId>hib-jsf-jta-dep</artifactId>
>           <type>pom</type>
>           <version>1.0</version>
>       </dependency>
> ===================================
> The pom project:
> ===================================
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>
>   <groupId>org.thejarbar</groupId>
>   <artifactId>facelets-dep</artifactId>
>   <version>1.0</version>
>   <packaging>pom</packaging>
>
>   <dependencyManagement>
>       <dependencies>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-api</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-impl</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>       </dependencies>
>   </dependencyManagement>
> </project>
> ================================
>
> I was under the impression that the two are identical?

You should add <scope>import</scope>. Just having the dependency means
it's available at compile time which is not of any help to you.

Note, though, that scope import is quite limited. It only works in the
dependencyManagement section. See
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Strange potential bug Maven2?

Posted by Yucca Nel <yu...@live.co.za>.
Many thanks. I am reading a oreilly Sonatype Maven and such valuable info 
not included :D

-----Original Message----- 
From: Hilco Wijbenga
Sent: Saturday, May 28, 2011 9:57 PM
To: Maven Users List
Subject: Re: Strange potential bug Maven2?

On 28 May 2011 07:09, Yucca Nel <yu...@live.co.za> wrote:
> Sorry, I will try be clearer... this:
> ================================
> <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-api</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-impl</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
> ====================================
> Is not the same as this:
> ====================================
> <dependency>
>           <groupId>org.thejarbar</groupId>
>           <artifactId>hib-jsf-jta-dep</artifactId>
>           <type>pom</type>
>           <version>1.0</version>
>       </dependency>
> ===================================
> The pom project:
> ===================================
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>
>   <groupId>org.thejarbar</groupId>
>   <artifactId>facelets-dep</artifactId>
>   <version>1.0</version>
>   <packaging>pom</packaging>
>
>   <dependencyManagement>
>       <dependencies>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-api</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-impl</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>       </dependencies>
>   </dependencyManagement>
> </project>
> ================================
>
> I was under the impression that the two are identical?

You should add <scope>import</scope>. Just having the dependency means
it's available at compile time which is not of any help to you.

Note, though, that scope import is quite limited. It only works in the
dependencyManagement section. See
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html. 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Strange potential bug Maven2?

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 28 May 2011 07:09, Yucca Nel <yu...@live.co.za> wrote:
> Sorry, I will try be clearer... this:
> ================================
> <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-api</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-impl</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
> ====================================
> Is not the same as this:
> ====================================
> <dependency>
>           <groupId>org.thejarbar</groupId>
>           <artifactId>hib-jsf-jta-dep</artifactId>
>           <type>pom</type>
>           <version>1.0</version>
>       </dependency>
> ===================================
> The pom project:
> ===================================
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>
>   <groupId>org.thejarbar</groupId>
>   <artifactId>facelets-dep</artifactId>
>   <version>1.0</version>
>   <packaging>pom</packaging>
>
>   <dependencyManagement>
>       <dependencies>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-api</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>           <dependency>
>               <groupId>com.sun.faces</groupId>
>               <artifactId>jsf-impl</artifactId>
>               <version>2.0.3</version>
>               <scope>compile</scope>
>           </dependency>
>       </dependencies>
>   </dependencyManagement>
> </project>
> ================================
>
> I was under the impression that the two are identical?

You should add <scope>import</scope>. Just having the dependency means
it's available at compile time which is not of any help to you.

Note, though, that scope import is quite limited. It only works in the
dependencyManagement section. See
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html.

Re: Strange potential bug Maven2?

Posted by Yucca Nel <yu...@live.co.za>.
Sorry, I will try be clearer... this:
================================
<dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
====================================
Is not the same as this:
====================================
<dependency>
            <groupId>org.thejarbar</groupId>
            <artifactId>hib-jsf-jta-dep</artifactId>
            <type>pom</type>
            <version>1.0</version>
        </dependency>
===================================
The pom project:
===================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.thejarbar</groupId>
    <artifactId>facelets-dep</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
================================

I was under the impression that the two are identical?

-----Original Message----- 
From: Yucca Nel
Sent: Saturday, May 28, 2011 3:29 PM
To: users@maven.apache.org
Subject: Strange potential bug Maven2?

Hello I am having an issue using the following setup:

IDEA 9.03
JDK 6.0.24
Maven 2
Tomcat 7.05

Basically I create a pom project for the sole purpose as a plugin dependency 
for my faces 2 (I plan on having 2 different such projects for JEE and plain 
servlet containers respectively.
I am running a sample project successfully using the following pom from the 
CLI (command: mvn package tomcat:deploy) with my project configured to use a 
local tomcat instance.
At this point everything works, but removing/refactoring the following:

========================================================
<dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
=======================================================

From:
========================================================
<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.jarbar.the</groupId>
    <artifactId>Jerel-Baker</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Jerel-Baker</name>
    <url>http://thejarbar.org/JerelBaker</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>2.0.3</version>
                <scope>compile</scope>
            </dependency>
    </dependencies>
    <build>
        <finalName>Jerel-Baker</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>tomcat-maven-plugin</artifactId>
                    <configuration>
                        <url>http://localhost:8080/manager/text</url>
                        <server>local_tomcat</server>
                        <path>/${project.build.finalName}</path>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.1</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
===========================================================
Into it’s own pom project and then installing it to local repo and then 
including that pom project as a depandancy,
causes failure when accessing the project in browser.

Something along the lines of duplicate TLD, but this tomcat it seems!

I look at my WEB-INF/lib and I see duplicate jsf-api and jsf-impl jars which 
I suspect is causing this.
Is there a reason why I am getting these duplicate jars that don’t 
match(versions)?

Another thing that is worth noting is that the FacesServlet is not found in 
classpath as is evident in IDEA but I am using exact same dependencies and 
only putting them into own pom project!
Is it IDEA or maven?

I can do a youtube video if this is not clear.... 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org