Missing artifact com.oracle:ojdbc6:jar:11.1.0.7.0 - java

Missing artifact com.oracle:ojdbc6:jar:11.1.0.7.0
I am using Spring tool suite IDE for developing spring maven project which is similar ecllipse IDE, I found Solutions for this issue on stackoverflow but it doesn't work for me'.
I tried two links:
Missing artifact com.oracle:ojdbc6:jar:11.2.0.3,
Oracle JDBC ojdbc6 Jar as a Maven Dependency
but still I am getting
Missing artifact com.oracle:ojdbc6:jar:11.1.0.7.0
error in pom.xml, I am now stuck at this point.

its because of ojdbc jar is not available on maven repo. so you have to add this dependency from local relative path
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/ojdbc6.jar</systemPath>
</dependency>
You can download ojdbc jar from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html

Related

Maven could not resolve dependencies/ find artifcat when its already present in .m2 repo

I am trying to build jboss 6.2.2 from source. I have configure the settings.xml to use the official jboss repository as described here.
However midway i am getting error
[ERROR] Failed to execute goal on project jboss-as-clustering-jgroups: Could not resolve dependencies for project org.jboss.as:jboss-as-clustering-jgroups:jar:7.3.2.Final-redhat-SNAPSHOT: Could not find artifact org.jboss.as:jboss-as-clustering-common:jar:tests:7.3.2.Final-redhat-SNAPSHOT -> [Help 1]
But when i see the .m2 repository it seems like it is being downloaded correctly and the jar is present there. I tried deleting the whole jboss-as-clustering-common folder and doing a fresh mvn install, but i got the same error, even though this folder was downloaded again. I also tried mvn clean and did a build again, but to no use. What can be possibly wrong?
I think jboss-as-clustering-common is a dependency of jboss-as-clustering-jgroups. Both poms are attached.
Did you mean to use it this way
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-clustering</artifactId>
<version>${Pick a version which you need to use}</version>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-clustering-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-clustering-jgroups</artifactId>
<version>${project.version}</version>
</dependency>

Not able to run my eclipse maven project- eclipse not recognising mySql-connector-java

I am nor able to run my eclipse maven project. I keep getting the following error in the problems tab
Archive for required library: 'C:/Users/user/.m2/repository/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar' in project 'Inspirations' cannot be read or is not a valid ZIP file
In my pom.xml file I have defined the dependency as
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
You can try delete mysql folder in your repository and go to eclipse -> Maven --> Update Project.
If not working, i thinh u can try another version.

Unable to execute Maven project with external jars as dependency

I am using Maven repository, I am trying to connect my application with MySQL database. I have added the required jar file as Maven dependency in my project.
I am able to build the project successfully but when I run the project it gives classNotFoundException.
I have added the jar location in CLASSPATH.
Gerold Broser is correct on top of that version it should be 5.1.37 not 5.1.37-bin
In maven this is the dependency :
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.37</version>
</dependency>
According to Maven Central the <groupId> for mysql-connector-java ist just mysql, not mysql-connector-java.
As mentioned in soorapadman's answer the (older) <version> is 5.1.37, not 5.1.37-bin, the latest is 6.0.3.
Additional hint: You don't have to declare <packaging>jar and <scope>compile explicitely, since these are the defaults anyway. (Remember Maven's core concept Convention over configuration.)

Specific spring-core jar to be included in project

Ive included following lines in my pom.xml
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
The specific spring-core JAR version I want is 4.1.6, but whenever I do an mvn clean install, the dependencies folder under my project in netbeans shows a downgraded version (currently 3.0.7.RELEASE).
I want to know how I can force maven to put 4.1.6.RELEASE jar in my dependencies folder. I've done
mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false
And I've the folder 4.1.6.RELEASE with correct jar in my local /.m2/repositories folder. I need to access org.springframework.util.MimeType class which is not available in spring-core 3.0.7.RELEASE jar.
See the result of mvn dependency:tree to know if another jar bring back the version 3.0.7. and exclude from this dependency the spring-core
See the same result to know if the right version is present
Add the pom.xml and the result of mvn dependency:tree in the question
Please follow these steps:
Check in .m2 local repository where the Spring 3.0.7 jar is downloaded(It should be under folder org->springframework)
Delete the folder present inside springframework, so that mvn will try to fetch required dependencies.
Let me know if it helps
The issue is that spring-core is a mandatory dependenecy of most spring artifacts. Most likely you are using a dependent artifact e.g spring-context which is of version 3.0.7. Then Maven is fetching spring-core of the same version as the dependent artifact using its transitive dependency mechanism.
To control the version of spring-core you need to move its declaration from the dependencies section to the dependency management section of your pom.xml as follows
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.1.6</version>
</dependency>
</dependencies>
</dependencyManagement>

Errors in maven Struts2 project

Eclipse displays errors in a Maven project. How can I fix it?
It seems that project works as it should.
Maven dependencies:
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-plugin</artifactId>
<version>3.7.1</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-grid-plugin</artifactId>
<version>3.7.1</version>
</dependency>
The jars downloaded from these artifacts should be on the classpath of the project Build Path. Subfolders aren't on the classpath, so eclipse can't find TLDs there. Configure the build path by adding project or external jars to the build classpath. You can see How to generate eclipse configuration from maven project.
Try /struts2-jquery-tags instead of /struts-jquery-tags. Missed the '2' in struts.

Categories

Resources