Iozan
Iozan

Reputation: 31

eclipse is not recognizing my maven dependency

I've managed to create a jar client from a wsdl with maven correctly, but now i want to use it on my main project. I'm adding the dependency correctly (the jar is correctly on the generated war, and it's also on my m2 repo), but it seems that eclipse is not recognizing its components.

these are partially the respective poms: "WSDL client generator"

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

  <parent>
    <groupId>es.tenentia.copal</groupId>
    <artifactId>parent</artifactId>
    <version>0.1-SNAPSHOT</version>
  </parent>

  **<groupId>es.tenentia.copal</groupId>
  <artifactId>copalWSClient</artifactId>
  <version>1.0-SNAPSHOT</version>**

  <packaging>jar</packaging>
  <name>CopalTool wsdl processor</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>axistools-maven-plugin</artifactId>
                <version>1.4</version>
                <dependencies>
                    <dependency>
                      <groupId>javax.mail</groupId>
                      <artifactId>mail</artifactId>
                      <version>1.4.1</version>
                    </dependency>
                    <dependency>
                      <groupId>javax.activation</groupId>
                      <artifactId>activation</artifactId>
                      <version>1.1</version>
                    </dependency>
                </dependencies>
                <configuration>
                  <!-- The plugin navigates your source src/main/** tree and finds your WSDLs for you;
                  just name them individually in a <wsdlFiles/> element. -->
                  <sourceDirectory>src/main/resources</sourceDirectory>
                  <wsdlFiles>
                    <wsdlFiles>ToolService.wsdl</wsdlFiles>
                  </wsdlFiles>


                  <!-- This is optional, but lets you explicitly namespace the generated code. -->
                  <!--
                  <packageSpace>com.axis.generated</packageSpace>
                  <testCases>true</testCases>
                  -->

                  <serverSide>true</serverSide>
                  <subPackageByFileName>true</subPackageByFileName>
                </configuration>

            <executions>
              <execution>
              <phase>generate-sources</phase>
                <goals>
                  <goal>wsdl2java</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
    </build>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
  <!-- *** AXIS DEPENDECES -->
    <dependency>
      <groupId>org.apache.axis</groupId>
      <artifactId>axis</artifactId>
      <version>1.4</version>
    </dependency>
    <dependency>
      <groupId>javax.xml</groupId>
      <artifactId>jaxrpc-api</artifactId>
      <version>1.1</version>
    </dependency>

    <!-- END AXIS -->

  </dependencies>
</project>

"war generator"

<?xml version="1.0" encoding="ISO-8859-15"?>
<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>

      <parent>
        <groupId>es.tenentia.copal</groupId>
        <artifactId>parent</artifactId>
        <version>0.1-SNAPSHOT</version>
      </parent>
    <groupId>es.tenentia.copal</groupId>
    <artifactId>copal</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>CopalTool War Processor</name>

    <properties>
        <struts2.version>2.3.14</struts2.version>
        <spring.version>3.0.7.RELEASE</spring.version>
        <project.build.sourceEncoding>ISO-8859-15</project.build.sourceEncoding>
    </properties>

    <dependencies>

        <!-- Struts 2  -->
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>${struts2.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-config-browser-plugin</artifactId>
            <version>${struts2.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-junit-plugin</artifactId>
            <version>${struts2.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-spring-plugin</artifactId>
            <version>${struts2.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts-taglib</artifactId>
            <version>1.3.10</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
            <version>2.4.2</version>
        </dependency>

        <!-- Spring Dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <!-- Exclude Commons Logging in favor of SLF4j -->
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

        <!-- Spring Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${spring.version}</version>
        </dependency>  

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
        </dependency>

        <!-- WebService dependency -->
        **<dependency>
          <groupId>es.tenentia.copal</groupId>
          <artifactId>copalWSClient</artifactId>
          <version>1.0-SNAPSHOT</version>
        </dependency>**


    <!-- Hibernate and database access -->
        <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc14</artifactId>
          <version>10.2.0.3.0</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.6.3.Final</version>
        </dependency>

    </dependencies>

    <build>
    <finalName>copaltool</finalName>
        <plugins>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>8.1.7.v20120910</version>
                <configuration>
                    <stopKey>CTRL+C</stopKey>
                    <stopPort>8999</stopPort>
                    <systemProperties>
                        <systemProperty>
                            <name>log4j.configuration</name>
                            <value>file:${basedir}/src/main/resources/log4j.properties</value>
                        </systemProperty>
                        <systemProperty>
                            <name>slf4j</name>
                            <value>false</value>
                        </systemProperty>
                    </systemProperties>
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
                    <webAppConfig>
                        <contextPath>/struts2-blank</contextPath>
                        <descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
                    </webAppConfig>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                        <version>1.2.17</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>

has anyone an idea of what can be happening?

thank you all!

Upvotes: 1

Views: 2254

Answers (1)

PJR
PJR

Reputation: 443

Based on what you have written, my first thought would be to check that all your desired jars/classes are in the build path in eclipse?

If not, you might need to use mvn eclipse:eclipse to generate the .classpath file and then use that. This is assuming you have a M2_REPO variable set and pointing to your local repo. You can inspect the generated .classpath file to make sure all your desired jars/classes are present.

You could also open the project properties and add the jar from your local repo as an external jar or add your first project as the 'required project on the build path' for your second project. The latter might be more convenient while your are developing.

Upvotes: 1

Related Questions