maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Celinio Fernandes <cel...@yahoo.com>
Subject Re: Could not find artifact javax.transaction:jta:jar:1.0.1B in central (http://repo1.maven.org/maven2)
Date Tue, 29 Mar 2011 02:56:58 GMT
I fixed my problem by adding the following repository in the project.core/pom.xml file :
<repositories>
  <repository>
        <id>maven2-repository.dev.java.net</id>
        <name>Java.net Repository for Maven</name>
        <url>http://download.java.net/maven/2/
        </url>
        <layout>default</layout>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
</repositories>
    </repository>
However, I would like to know / understand why installing the indirectly referenced jta-1.0.1B.jar
library in my local repository did not work. It keeps looking in the global repository.
Isn't Maven supposed to first check the libraries that are available in the local repository
and then eventually check the global repository (or any other repository) ?

Thanks.

--- On Mon, 3/28/11, Celinio Fernandes <cel975@yahoo.com> wrote:

From: Celinio Fernandes <cel975@yahoo.com>
Subject: Re: Could not find artifact javax.transaction:jta:jar:1.0.1B in central (http://repo1.maven.org/maven2)
To: "Maven Users List" <users@maven.apache.org>
Date: Monday, March 28, 2011, 1:13 PM

I would like to add more information :

1) C:\Users\userbob\.m2\  does not have a settings.xml file. 
2) Rebuilding the index of the local repository in Eclipse (Repositories view) did not change
anything

Does anyone have an idea ? Thanks.

--- On Mon, 3/28/11, Celinio Fernandes <cel975@yahoo.com> wrote:

From: Celinio Fernandes <cel975@yahoo.com>
Subject: Could not find artifact javax.transaction:jta:jar:1.0.1B in central (http://repo1.maven.org/maven2)
To: "Maven Users List" <users@maven.apache.org>
Date: Monday, March 28, 2011, 1:07 PM

Hi,
I have a small problem with some dependency.
First a word about my environment :
Eclipse Helios
Maven with the M2Eclipse plugin
Maven 3.0.2
jdk 1.6
Windows 7

My project is made of 1 parent project and 2 other projects (modules).
First i had a problem with the ojdbc14 library. It was complaining that it could not find
the ojdbc14.jar :
com.oracle:ojdbc14:jar:10.2.0.2.0

So I fixed it with the following command :
mvn install:install-file -Dfile=D:\Dev\oracle\oracleexpress\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar
-Dpackaging=jar 
-DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.1.0

I added it to the local repository. 
But then i get another error when i run "mvn install" from Eclipse, using the M2eclipse plugin
:
[ERROR] Failed to execute goal on project projet.core: Could not resolve dependencies for
project 
fr.celinio.gwt:projet.core:jar:0.0.1-SNAPSHOT: Could not find artifact javax.transaction:jta:jar:1.0.1B
in central (http://repo1.maven.org/maven2) -> [Help 1]

So I installed the jta:jar in my local repository, like i did for the ojdbc.jar library :
 mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar
-Dfile=D:\Temp\jta-1_1-classes.jar   
 
But why does it keep looking into the central repository (http://repo1.maven.org/maven2) ?
Shouldn't Maven look first in the local repository, find the library and then skip looking
in the central repository ?


Here is the pom.xml of my parent project :

<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>fr.celinio.gwt</groupId>
  <artifactId>projet.parent</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>projet.parent</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <modules>
      <module>projet.core</module>
      <module>../projet.gwt</module>
  </modules>
  
</project>


Here is the pom.xml of the projet.core module (the project with the ojdbc14.jar dependency)
:

<?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>
  <parent>
    <artifactId>projet.parent</artifactId>
    <groupId>fr.celinio.gwt</groupId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <groupId>fr.celinio.gwt</groupId>
  <artifactId>projet.core</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>projet.core</name>
  <packaging>jar</packaging>
        <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.java</include>
                </includes>
            </resource>
<!--             <resource> -->
<!--                 <directory>src/main/resources</directory>
-->
<!--                 <includes> -->
<!--                     <include>**/*.*xml</include> -->
<!--                     <include>**/*.*properties</include>
-->
<!--                 </includes> -->
<!--             </resource> -->
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/java</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </testResource>
        </testResources>
    </build>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
    
<!--   <repositories> -->
<!-- <repository> -->
<!-- <id>java.net</id> -->
<!-- <name>The Java.net Maven repository</name> -->
<!-- <url>http://download.java.net/maven/2</url> -->
<!-- </repository> -->
<!--   </repositories> -->
  
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    
  
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate</artifactId>
        <version>3.2.6.ga</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring</artifactId>
        <version>2.5.6</version>
    </dependency>
       <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc14</artifactId>
        <version>10.2.0.1.0</version>
    </dependency>
    
  </dependencies>
</project>


And here is the pom.xml of the other module :

<?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/maven-v4_0_0.xsd">

  <!-- POM file generated with GWT webAppCreator -->
  <modelVersion>4.0.0</modelVersion>
    <parent>
    <artifactId>projet.parent</artifactId>
    <groupId>fr.celinio.gwt</groupId>
    <version>0.0.1-SNAPSHOT</version>
      <relativePath>../projet.parent/pom.xml</relativePath>
    
  </parent>
  
  <groupId>fr.celinio.gwt</groupId>
  <artifactId>projet.gwt</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>GWT Maven Archetype</name>

  <dependencyManagement>
      <dependencies>
          <dependency>
              <groupId>fr.celinio.gwt</groupId>
              <artifactId>projet.core</artifactId>
              <version>0.0.1-SNAPSHOT</version>
              <type>jar</type>
              <scope>compile</scope>
          </dependency>
      </dependencies>
  </dependencyManagement>
  <properties>
    <!-- Convenience property to set the GWT version -->
    <gwtVersion>2.1.0</gwtVersion>
    <!-- GWT needs at least java 1.5 -->
    <maven.compiler.source>1.5</maven.compiler.source>
    <maven.compiler.target>1.5</maven.compiler.target>
    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
      <version>2.2.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.2.0</version>
      <scope>provided</scope>
    </dependency>  
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.7</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <!-- Generate compiled stuff in the folder used for developing mode -->
    <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>

    <plugins>

      <!-- GWT Maven Plugin -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.2.0</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>test</goal>
              <goal>i18n</goal>
              <goal>generateAsync</goal>
            </goals>
          </execution>
        </executions>
        <!-- Plugin configuration. There are many available options, see gwt-maven-plugin

          documentation at codehaus.org -->
        <configuration>
          <runTarget>Application.html</runTarget>
          <hostedWebapp>${webappDirectory}</hostedWebapp>
          <i18nMessagesBundle>fr.celinio.gwt.projet.gwt.client.Messages</i18nMessagesBundle>
        </configuration>
      </plugin>

      <!-- Copy static web files before executing gwt:run -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>exploded</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <webappDirectory>${webappDirectory}</webappDirectory>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>


Thanks for helping.



      


      


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message