Spring boot Cannot load driver class: oracle.jdbc.OracleDrive - oracle

I have driver class in class-path in my jar:
2015-06-18 12:21:40.290 INFO 9453 --- [ main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath:
.....
jar:file:/{projecthome}/rest-test/target/rest-test-0.1.0.jar!/lib/ojdbc6-11.2.0.3.0.jar!/]
I got exception:
Factory method 'dataSource' threw exception; nested exception is java.lang.IllegalStateException: Cannot load driver class: oracle.jdbc.OracleDrive
My pom:
<?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.springframework</groupId>
<artifactId>rest-test</artifactId>
<version>0.1.0</version>
<packaging>jar</packaging>
<properties>
<start-class>hello.Application</start-class>
<java.version>1.8</java.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.4.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
<name>rest-test</name>
</project>

Download ojdbc6.jar from Oracle website or if you install oracle11g in your local system you can find ojdbc in jdbc/lib folder.
Add that ojdbc.jar right click --> build path--> configure build path--> Add external jars--> your local machine ojdbc path -->ok.
It worked in my case.

step 1:You POM.xml file should be
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency>
Step 2:Download the ojdbc6 driver from oracle website and keep it in your local machine.
step 3:Run maven below command.Dfile is the location where i kept my jar file downloaded from oracle website
mvn install:install-file
-Dfile=C:\Users\santosh\.m2\repository\com\oracle\ojdbc6\11.2.0\ojdbc6.jar
-DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar
After running maven command it should create ojdbc6-11.2.0 in your maven repository.After that your problem should be fixed.

Make sure that in your IDE you click maven reimport if it is not reimporting automatically (i.e. IntelliJ: right click project, Maven, Reimport), as it will compile fine without being on the classpath, but fail at runtime

In pom.xml add dependency as told by Santosh.
In Eclipse IDE Right click upon your Project and select -- Run As -- Maven build... -- in Goals provide below line and Run. I have just removed mvn and pointed ojdbc6.jar location in my local machine.
install:install-file -Dfile=D:\oracle11gXE\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar
Again in Eclipse IDE Right click upon your Project and select -- Maven -- Update Project... -- select Force Update of Snapshots/Releases along with other default options and click OK.
ojdbc6-11.2.0.jar should reflect under Maven Dependencies.

Related

maven - anypoint studio fails to load a maven module inside a mule project

I've created a custom Mule extension, and I wanted to test it by loading it into a mule demo project as a mule-plugin.
I'm using Anypoint Studio 7.9.0, I have Maven 3.6.3 installed.
I run mvn clean package to create the .jar of my custom mule extension, and then mvn clean install to install it into my local Maven repository.
When I go to {mule demo project} -> Manage Dependencies -> Manage Modules -> Add module from Maven and try to add my custom mule extension to the mule demo project in which I want to test it, I get this error: Failed to resolve module {groupID}:{module name}
Frankly, I'm stuck here for some time now, and cannot figure out what I'm missing.
Here's the pom.xml of my custom mule extension:
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>custom-mule-extension</artifactId>
<version>0.1.1</version>
<packaging>mule-extension</packaging>
<name>Custom Mule Extension</name>
<parent>
<groupId>org.mule.extensions</groupId>
<artifactId>mule-modules-parent</artifactId>
<version>1.1.3</version>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.14.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.5</version>
</dependency>
</dependencies>
And this is the pom.xml of my mule demo application:
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>elastic-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule-application</packaging>
<name>elastic-demo</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.3.0-20210322</app.runtime>
<mule.maven.plugin.version>3.5.1</mule.maven.plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-maven-plugin</artifactId>
<version>${mule.maven.plugin.version}</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-sockets-connector</artifactId>
<version>1.2.2</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>org.mule.connectors</groupId>
<artifactId>mule-http-connector</artifactId>
<version>1.5.25</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mycompany</groupId>
<artifactId>custom-mule-extension</artifactId>
<version>0.1.1</version>
<classifier>mule-plugin</classifier>
</dependency>
</dependencies>
<repositories>
<repository>
<id>anypoint-exchange-v2</id>
<name>Anypoint Exchange</name>
<url>https://maven.anypoint.mulesoft.com/api/v2/maven</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<url>https://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-releases</id>
<name>MuleSoft Releases Repository</name>
<layout>default</layout>
<url>https://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
The custom-mule-extension <dependency> element is the one that cannot be resolved. As you can see from the snippet above, I inserted the dependency directly into the pom.xml file after the "Add modules" way from Anypoint Studio UI failed. And here, I get the error that the module cannot be resolved.
One thing that bothers me is: when I launch the mvn clean install -DskipTests command, there is one [INFO] log that doesn't look good, and it's the one saying No primary artifact to install, installing attached artifacts instead.
The build goes fine, and the dependency pops up into my local maven repository, but then I cannot add it to the mule demo project.
Any help or advice would be much appreciated.
Thanks in advance.

Cannot include project artifact: com.test.mmm.jar:1.0; it doesn't have an associated file or directory

I'm pretty lost with maven and I can't seem to find a solution for my problem. When I try to generate the jar file with all the dependencies of my project to execute it on another computer I find this warning when I execute sudo mvn clean compile assembly:single:
[WARNING] Cannot include project artifact: com.test:mmm:jar:1.0; it doesn't have an associated file or directory.
Also, when I try to execute the .jar with java -jar target/test.jar this error appears:
Error: Unable to access jarfile target/test.jar
here's my pom.xml:
<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>com.test</groupId>
<artifactId>mmm</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>mmm</name>
<url>http://maven.apache.org</url>
<properties>
<nd4j.backend>nd4j-cuda-8.0-platform</nd4j.backend>
</properties>
<dependencies>
<dependency>
<groupId>org.jblas</groupId>
<artifactId>jblas</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>nd4j-native-platform</artifactId>
<version>0.8.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.deeplearning4j</groupId>
<artifactId>deeplearning4j-core</artifactId>
<version>0.8.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<archive>
<manifest>
<mainClass>com.test.mmm.Main</mainClass>
</manifest>
</archive>
<finalName>test</finalName>
<descriptorRefs>jar-with-dependencies</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
The main class is located in src/
I've tried many solutions from stack overflow but had no success, can someone help me?
Thank you!
Use mvn package first to build your module classes then assembly:single.
mvn package assembly:single
From the warning you've included in your question:
[WARNING] Cannot include project artifact: Amjar:amjar:pom:0.2; it doesn't have an associated.
I'd guess that you've got the packaging in your pom.xml set to pom.
This is fine if your module is simply packaging a set of dependencies or resource files, however, if you also want Maven to create a jar containing the classes in you module you will need to set the packaging to jar.
make sure that your atrifact produced is matching with <finalName>
i.e.
<groupId>com.rocket</groupId>
<artifactId>myapp</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>myapp</name>
produces myapp-1.0.jar
and provide same here
<finalName>myapp-1.0</finalName>
and run then execute:
mvn package assembly:single

Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7

I was developing a project on JBoss-Fuse from Create a Router Project.
While running mvn -install , I am getting following error:
[ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:bundle (default-bundle) on project camel-basic: Error calculating classpath for project MavenProject: org.fusesource.example:camel-basic:1.0-SNAPSHOT # /home/pr.singh/Gemini/Java-General/Workspace/fuse/camel-basic/pom.xml: The JAR/ZIP file (/home/pr.singh/.m2/repository/org/apache/camel/camel-jetty/2.17.0.redhat-630187/camel-jetty-2.17.0.redhat-630187.jar) seems corrupted, error: invalid END header (bad central directory offset) -> [Help 1]
I exactly following the redhat tutorial, I am unable to debug the problem. Please help.
My pom.xml is :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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.fusesource.example</groupId>
<artifactId>camel-basic</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>JBoss Fuse Quickstart: camel-cbr</name>
<description>Camel Content-Based Router Example</description>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<distribution>repo</distribution>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.compiler.plugin>2.3.1</version.compiler.plugin>
<version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<!-- the version of the BOM, defining all the dependency versions -->
<fabric8.bom.version>1.2.0.redhat-630187</fabric8.bom.version>
<fabric.version>1.2.0.redhat-630187</fabric.version>
<!-- fabric8 deploy profile configuration -->
<fabric8.profile>camel-basic-profile</fabric8.profile>
<fabric8.parentProfiles>feature-camel</fabric8.parentProfiles>
<fabric8.features/>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.fabric8.bom</groupId>
<artifactId>fabric8-bom</artifactId>
<version>${fabric8.bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!--
For this example, we will be using the OSGi Blueprint XML syntax for Apache Camel.
-->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-blueprint</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.compiler.plugin}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${version.maven-bundle-plugin}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<!--
this plugin will use the fabric.* properties to configure its behaviour
see the Properties section here: http://fabric8.io/gitbook/mavenPlugin.html
-->
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fabric.version}</version>
</plugin>
</plugins>
</build>
</project>
After digging a bit about the issue, I found the solution to it.
After reading the line of error code that says:
Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.7:bundle
I thought there is some issue with org.apace.felix, but later I paid attention to the line of error that was stating :
The JAR/ZIP file (/home/pr.singh/.m2/repository/org/apache/camel/camel-jetty/2.17.0.redhat-630187/camel-jetty-2.17.0.redhat-630187.jar) seems corrupted
Issue:
So the issue was that my camel-jetty jar was corrupted.
Solution:
I simple navigated to /home/pr.singh/.m2/repository/org/apache/camel and deleted camel jetty.
Run mvn clean install on project and new file with name camel jetty was created (maven installed this plugin). And error was gone.

Maven error - Spring Surf Alfresco

To construct a project Spring Surf on Alfresco, I used the command:
mvn archetype:generate -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/archetype-catalog.xml
I gave groupId=surfcmistest and artifactId=surfcmistest-1.0-SNAPSHOT. Then, on the folder surfcmistest-1.0-SNAPSHOT created by the project, I try to make build and package with Maven. I run:
mvn install
and I obtain the error:
Failed to execute goal on project surfcmistest-1.0-SNAPSHOT: Could not resolve dependencies for project surfcmistest:surfcmistest-1.0-SNAPSHOT:war:1.0-SNAPSHOT: Failed to collect dependencies at org.springframework.extensions.surf:spring-surf:jar:5.1-BF-SNAPSHOT: Failed to read artifact descriptor for org.springframework.extensions.surf:spring-surf:jar:5.1-BF-SNAPSHOT: Failure to find org.alfresco:alfresco-parent:pom:5.1-BF-SNAPSHOT in https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of Alfresco-Artifacts has elapsed or updates are forced -> [Help 1]
My pom.xml is:
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>surfcmistest</groupId>
<artifactId>surfcmistest-1.0-SNAPSHOT</artifactId>
<packaging>war</packaging>
<name>sample-app Maven Webapp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>Alfresco-Artifacts</id>
<name>Alfresco Artifacts SNAPSHOTS</name>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf</artifactId>
<version>5.1-BF-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.extensions.surf</groupId>
<artifactId>spring-surf-api</artifactId>
<version>5.1-BF-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.tuckey</groupId>
<artifactId>urlrewritefilter</artifactId>
<version>4.0.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.2.2.v20140723</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp</scanTarget>
</scanTargets>
</configuration>
</plugin>
</plugins>
</build>
<version>1.0-SNAPSHOT</version>
</project>
What is my error?
The error message you are getting is:
resolution will not be reattempted until the update interval of Alfresco-Artifacts has elapsed or updates are forced
This is a very classic error and it is resolved by running Maven with the -U option.
You should restart from scratch and follow this procedure:
Remove your whole m2 repository (the default location is ~/.m2/repository) and remove any directory created by an earlier execution of the maven-archetype-plugin.
Run the command:
mvn archetype:generate -DarchetypeCatalog=https://artifacts.alfresco.com/nexus/content/groups/public-snapshots/archetype-catalog.xml
Choose the option org.springframework.extensions.surf:spring-surf-archetype (for me, it was option 1 but it can change).
Choose the version 5.1-SNAPSHOT, which was option 4 for me (but again, this can change)
Select a groupId, an artifactId, a version, a package and confirm all those properties by pressing Y.
Go into the newly created directory (it will be named after the artifactId you chose earlier) and run the following Maven command:
mvn -U clean install

How should I configure pom.xml to keep A and B in my private local Maven repo cache while using Maven Central and java.net's Maven repositories?

How should I configure pom.xml to keep A and B in my private local Maven repo cache while using Maven Central and java.net's Maven repositories?
I've got two local private projects, call them A and B, but both depend on a few bug fixes in org.javolution:javolution-core-java:6.1.0-SNAPSHOT, which isn't in Maven Central. Both A and B depend on other artifacts which are in Maven Central. Project B depends on project A.
I'm used to using Maven with the local repository (cache) in ~/.m2 and Central, but it seems like I'm not configuring the project correctly for the java.net repository.
<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>com.redacted</groupId>
<artifactId>B</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>B</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<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>
<dependency>
<groupId>com.opera.link.api</groupId>
<artifactId>opera-link-client</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.javolution</groupId>
<artifactId>javolution-core-java</artifactId>
<version>6.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.5</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>A</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Java.net Maven Repository</id>
<url>https://maven.java.net/content/repositories/snapshots/</url>
</repository>
</repositories>
</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>com.redacted</groupId>
<artifactId>A</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>A</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<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>
<dependency>
<groupId>org.javolution</groupId>
<artifactId>javolution-core-java</artifactId>
<version>6.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.2.5</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>Java.net Maven Repository</id>
<url>https://maven.java.net/content/repositories/snapshots/</url>
</repository>
</repositories>
</project>
Removing the <repositories> element from B produces the obvious result:
------------------------------------------------------------------------
Building B 1.0-SNAPSHOT
------------------------------------------------------------------------
The POM for org.javolution:javolution-core-java:jar:6.1.0-SNAPSHOT is missing, no dependency information available
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 0.547s
Finished at: Wed Jan 29 17:19:48 EST 2014
Final Memory: 3M/15M
------------------------------------------------------------------------
Adding the <repositories> element back in to B gives this on running:
------------------------------------------------------------------------
Building B 1.0-SNAPSHOT
------------------------------------------------------------------------
--- exec-maven-plugin:1.2.1:exec (default-cli) # B ---
java.lang.ExceptionInInitializerError
Caused by: java.lang.RuntimeException: Uncompilable source code - package com.redacted.A.posts does not exist
at com.redacted.B.App.<clinit>(App.java:30)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.219s
Finished at: Wed Jan 29 17:50:45 EST 2014
Final Memory: 4M/15M
------------------------------------------------------------------------
As I'm typing this, I'm realizing perhaps this might not be a Maven problem as much as a NetBeans problem. I clicked the "Re-Run Goals" button expecting a clean-and-build (as that's what I last executed), but doing a real clean-and-build seems to compile correctly, while "Re-Run Goals" just makes mvn run the exec goal. Is my pom.xml configured correctly?
Edit: I'm using NetBeans 7.4.
Your first error message means that the javolution-SNAPSHOT couldn't be found. You have to provide a jar with pom in your local repository or buy using the java.net-repository.
The second error message results from running project B by the Exec-Maven-Plugin. The strange message seems a little bit missleading.
I would recommend you:
First put your custom javolution-SNAPSHOT.jar into your local maven repository by using the maven install-goal
If in doubt, which libraries you need from java.net, put the repository location into Project A as well as Project B.
Next install Project A into your local maven repository by using the maven install-goal.
Next install Project B into your local maven repository.

Resources