Maven error from Jenkins - maven

I am running Jenkins 1.599. I have created a new freeStyle project, which executes the batch command mvn clean install.
If I do run the same batch command from the windows shell, the maven command runs successfully.
However, when Jenkins executes it, I get a maven failure, as shown below:
C:\Program Files (x86)\Jenkins\jobs\AppHistData Freestyle\workspace>[workspace] $ cmd /c call C:\Windows\TEMP\hudson3523791316528515292.bat
C:\Program Files (x86)\Jenkins\jobs\AppHistData Freestyle\workspace>C:\\develop\\AppHistData\\AppHistDataMvn\\maven_run.bat
C:\Program Files (x86)\Jenkins\jobs\AppHistData Freestyle\workspace>cd C:\develop\AppHistData\AppHistDataMvn
C:\develop\AppHistData\AppHistDataMvn>C:\maven-3.2.5\bin\mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AppHistDataMvn 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for TradingInstrument:TradingInstrument:jar:1 is missing, no dependency information available
[WARNING] The POM for allinonetrade:allinonetrade:jar:1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.823 s
[INFO] Finished at: 2015-03-04T12:21:16+01:00
[INFO] Final Memory: 15M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project AppHistDataMvn: Could not resolve dependencies for project com.deepfieldcapital:AppHistDataMvn:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: TradingInstrument:TradingInstrument:jar:1, allinonetrade:allinonetrade:jar:1: Failure to find TradingInstrument:TradingInstrument:jar:1 in http://bits.netbeans.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of maven2-repository.netbeans.maven2 has elapsed or updates are forced -> [Help 1]
[ERROR]
The POM.xml is as below:
<?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>deepFieldCapital</groupId>
<artifactId>TradeInstManager</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>TradeInstManager</name>
<organization>
<name>Deep Field Capital</name>
</organization>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.deepfieldcapital.tradeinstmanager.TradeInstrumentManagerMain</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>lib</id>
<url>file:../lib</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.6.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.31</version>
</dependency>
<dependency>
<groupId>org.swinglabs</groupId>
<artifactId>swing-layout</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>TradingInstrument</groupId>
<artifactId>TradingInstrument</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>BrokerOld</groupId>
<artifactId>BrokerOld</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>Utilities</groupId>
<artifactId>Utilities</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>allinonetrade</groupId>
<artifactId>allinonetrade</artifactId>
<version>1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<type>jar</type>
</dependency>
</dependencies>
</project>

Related

Creating a multi module project with maven spring and kotlin get unresolved reference

I am trying to build a multi module maven project with kotlin and spring. I get an error when the kotlin-maven-plugin runs the compile phase.
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) # starter ---
[INFO] Deleting /Users/pnts/IdeaProjects/getyour/base/starter/target
[INFO]
[INFO] --- git-commit-id-plugin:2.2.6:revision (default) # starter ---
[INFO]
[INFO] --- git-commit-id-plugin:2.2.6:revision (get-the-git-infos) # starter ---
[INFO]
[INFO] --- kotlin-maven-plugin:1.3.41:compile (compile) # starter ---
[INFO] Applied plugin: 'spring'
[ERROR] /Users/pnts/IdeaProjects/getyour/base/starter/src/main/kotlin/org/getyour/webdesign/PlainStarter.kt: (6, 9) Unresolved reference: WebsiteEntryPoint
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for parent 0.0.1-SNAPSHOT:
[INFO]
[INFO] parent ............................................. SUCCESS [ 1.178 s]
[INFO] common ............................................. SUCCESS [ 0.021 s]
[INFO] platform-api ....................................... SUCCESS [ 4.238 s]
[INFO] platform-core ...................................... SUCCESS [ 0.215 s]
[INFO] platform-bom ....................................... SUCCESS [ 0.012 s]
[INFO] platform-parent .................................... SUCCESS [ 0.061 s]
[INFO] starter ............................................ FAILURE [ 0.343 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.399 s
[INFO] Finished at: 2019-09-27T08:57:04+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.3.41:compile (compile) on project starter: Compilation failure
[ERROR] /Users/pnts/IdeaProjects/getyour/base/starter/src/main/kotlin/org/getyour/webdesign/PlainStarter.kt:[6,9] Unresolved reference: WebsiteEntryPoint
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :starter
The funny thing is when I clean my build with "mvn clean" and run the project it compiles and run the spring application.
Spring starts normal
I dont know what causes this issue. Maybe I am missing something.
Here are my poms and my project structure. Hope somebody can help me with this.
parent pom.xml
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath/>
</parent>
<version>0.0.1-SNAPSHOT</version>
<artifactId>parent</artifactId>
<groupId>org.getyour.webdesign</groupId>
<packaging>pom</packaging>
<modules>
<module>common</module>
<module>starter</module>
</modules>
<!-- properties -->
<properties>
<kotlin.version>1.3.41</kotlin.version>
<spring.boot.version>2.1.8.RELEASE</spring.boot.version>
<java.version>1.8</java.version>
<main.class>org.getyour.webdesign.WebsiteEntryPoint</main.class>
</properties>
<!-- repositories -->
<repositories>
<repository>
<id>maven-central</id>
<url>http://central.maven.org/maven2/</url>
</repository>
</repositories>
<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<pluginManagement>
<plugins>
<plugin>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- kotlin spring compiler plugin -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<mainClass>${main.class}</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals><goal>compile</goal></goals>
<phase>process-sources</phase>
</execution>
<execution>
<id>test-compile</id>
<goals><goal>test-compile</goal></goals>
<phase>process-test-sources</phase>
</execution>
</executions>
<configuration>
<args>
<arg>-Xjsr305=strict</arg>
</args>
<compilerPlugins>
<plugin>spring</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-allopen</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.6</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<prefix />
<verbose>false</verbose>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties
</generateGitPropertiesFilename>
<format>properties</format>
<gitDescribe>
<skip>false</skip>
<always>false</always>
<dirty>-dirty</dirty>
</gitDescribe>
</configuration>
</plugin>
</plugins>
</build>
</project>
starter pom.xml
<?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>
<parent>
<artifactId>parent</artifactId>
<groupId>org.getyour.webdesign</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<version>0.0.1-SNAPSHOT</version>
<artifactId>starter</artifactId>
<packaging>jar</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.getyour.webdesign</groupId>
<artifactId>platform-bom</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.getyour.webdesign</groupId>
<artifactId>platform-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency>
</dependencies>
</project>
WebsiteEntryPoint.kt
package org.getyour.webdesign
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
/**
* Start class of the application
*
* #author p.tsivelekidis
* Created by p.tsivelekidis on 2019-09-20
*/
#SpringBootApplication
class WebsiteEntryPoint {
companion object {
fun main(args: Array<String>) {
runApplication<WebsiteEntryPoint>(*args)
println("Hello!")
}
}
}
PlainStarter.kt
package org.getyour.webdesign
class PlainStarter
fun main(args: Array<String>) {
WebsiteEntryPoint.main(args)
}
Here is my project structure. Notice that when I run the "mvn clean install" command I get this.
project structure after mvn clean install
When I clean my project and just run I get this structure.
project structure after clean and just run project
When I run the mvn clean install it does not create the target classes and I guess for that reason it cant find my WebsiteEntryPoint.
Hope somebody can help me with that. Thanks a lot.
i had the same issue with compiling a kotlin multi module project in intellij.
Command mvn clean install produced the same error with the unresolved dependencies.
As i can see your source directories are named kotlin (as in my project before).
After renaming the source directories in my project to java the problem was solved...

Grails - building modularized project with maven

I am developing grails 2.3.4 application and I'm trying to add maven (3.1.1) for build purposes. I do it so because my project is modularized (2 plugins, 1 app - for now, there will be many more plugins later) and I would like to have tool that supports it (I failed to use Gradle but thats totally another topic). Recently I found some problems that I don't understand and which makes my brain hurt. I would be very grateful for any help about them.
My project structure looks like this:
my_project/
my_project-domain/ (plugin)
pom.xml
my_project-services/ (plugin)
pom.xml
my_project-webap/ (app)
pom.xml
pom.xml
My parent pom.xml:
<?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>my.app.group</groupId>
<artifactId>myArtifactId</artifactId>
<packaging>pom</packaging>
<version>0.0.2</version>
<name>myArtifactId</name>
<properties>
<grails.version>2.3.4</grails.version>
<h2.version>1.3.170</h2.version>
</properties>
<repositories>
...
</repositories>
<modules>
<module>my_project-domain</module>
<module>my_project-services</module>
<module>my_project-webapp</module>
</modules>
<dependencies>
<!-- MONGODB -->
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>mongodb</artifactId>
<version>1.3.0</version>
<scope>compile</scope>
<type>zip</type>
<exclusions>
<!-- proper spring-core and spring-beans version included by org.grails:grails-plugin-services -->
<exclusion>
<artifactId>spring-core</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-beans</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- TOMCAT needed during testing -->
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>tomcat</artifactId>
<version>7.0.47</version>
<scope>provided</scope>
<type>zip</type>
</dependency>
<!-- without h2 TOMCAT throws DataSource errors -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
<scope>test</scope>
</dependency>
<!-- GRAILS dependencies-->
<dependency>
<groupId>org.grails</groupId>
<artifactId>grails-plugin-async</artifactId>
<version>${grails.version}</version>
</dependency>
...
</dependencies>
<build>
<pluginManagement/>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
...
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
...
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
...
</plugin>
<plugin>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
<version>${grails.version}</version>
<configuration>
<fork>true</fork>
<!-- for debugging <forkDebug>true</forkDebug> -->
</configuration>
<extensions>true</extensions>
...
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>tools</id>
...
</profile>
</profiles>
</project>
Sample child pom.xml:
<?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>
<parent>
<groupId>my.app.group</groupId>
<artifactId>myArtifactId</artifactId>
<version>0.0.2</version>
<relativePath>..</relativePath>
</parent>
<groupId>my.app.group</groupId>
<artifactId>my_project-services</artifactId>
<packaging>grails-plugin</packaging>
<version>0.0.2</version>
<name>my_project-services</name>
<description>my_project-services</description>
<dependencies>
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>rest</artifactId>
<version>0.8</version>
<scope>runtime</scope>
<type>zip</type>
</dependency>
</dependencies>
</project>
I can execute integration tests trough:
mvn test - (from parent dir or child dirs) - which executes only unit tests
grails:test-app - (from child dir) - which executes unit and integration tests
mvn grails:test-app - (only from child dir) which executes unit and integration tests - but it executes them two times instead of one (u,i and then once more u,i)
mvn grails:execute -Dcommand=test-app - (only from child dir) - which executes unit and integration tests in the right amount (u,i) BUT during integration tests some of them suddenly start fail(!!!!) It just blows my mind why..
So, if there is anybody who tried to mix grails 2.3, maybe you have some information about:
how can I configure maven to be able to run mvn grails:test-app from parent pom, not to have such result:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] myArtifactId
[INFO] my_project-domain
[INFO] my_project-services
[INFO] my_project-webapp
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myArtifactId 0.0.2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- grails-maven-plugin:2.3.4:test-app (default-cli) # myArtifactId ---
|Loading Grails 2.3.4
|Configuring classpath
|Running pre-compiled script
.
|Environment set to test
.......
|Application metadata not found, please run: grails upgrade
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] myArtifactId ..................................... FAILURE [7.116s]
[INFO] my_project-domain ................................ SKIPPED
[INFO] my_project-services .............................. SKIPPED
[INFO] my_project-webapp ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
why integration tests executed by mvn grails:test-app pass and by mvn grails:exec -Dcommand=tests-app fail and how to fix it? I would need exec command for some specific purposes and I want to be able to rely on it. It's my biggest problem, I totally don't understand what could be it's cause
why mvn grails:tests-app results in double tests execution?
why I need to add h2 dependency for tomcat? In my dataSources I have only mongodb configuration and I would like to stick only to it and not see below error every time I execute integration tests:
|Completed 8 unit tests, 0 failed in 0m 2s
........pool.ConnectionPool Unable to create initial connections of pool.
java.sql.SQLException: org.h2.Driver
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
...
Caused by: java.lang.ClassNotFoundException: org.h2.Driver
at org.grails.launcher.RootLoader.findClass(RootLoader.java:147)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.grails.launcher.RootLoader.loadClass(RootLoader.java:119)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:246)
... 331 more
........
|Running 4 integration tests...
Thanks for everybody who got so far and is still reading - no matter if you can help or not:)
Tom

maven compilation fails because unavailable dependency

I'm trying to run java program with maven but when i compiled using the command mvn -U compile
he shows me the following error
[root#onePK-EFT1 tutorials]# mvn -U compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building onePK Java Tutorials 0.6.0.5
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/com/cisco/onep/libonep-core-rel
/0.6.0.5/libonep-core-rel-0.6.0.5.pom
[WARNING] The POM for com.cisco.onep:libonep-core-rel:jar:0.6.0.5 is missing, no
dependency information available
Downloading: http://repo.maven.apache.org/maven2/com/cisco/onep/libonep-
core-rel/0.6.0.5/libonep-core-rel-0.6.0.5.jar
[INFO] ------------------------------------------------------------------------
INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.517s
[INFO] Finished at: Tue Jul 09 07:28:28 PDT 2013
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project java-tutorials: Could not resolve
dependencies for project com.cisco.onep:java-tutorials:jar:0.6.0.5: Could not find
artifact com.cisco.onep:libonep-core-rel:jar:0.6.0.5 in central
(http://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read
the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN
/DependencyResolutionException
and this is my pom.xml file
<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.cisco.onep</groupId>
<artifactId>hello-network-app</artifactId>
<version>0.1-SNAPSHOT</version>
<name>The onePK Hello Network Example Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<forkMode>always</forkMode>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.cisco.onep</groupId>
<artifactId>libonep-core-rel</artifactId>
<version>0.6.0.5</version>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.6.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<developers>
<developer>
<name>onePK Team</name>
<email>onepk-feedback#cisco.com</email>
<organization>Cisco.com</organization>
</developer>
</developers>
I think it's because he can't find libonep-core-rel.jar which i have it included
please any help
The simple solution is to use the appropriate maven repository for the artifacts com.cisco.onep* which are not located in Maven central.
As an immediate solution, but not a recommendation, you can use system dependencies to resolve artifacts on your local filesystem.
As #khmarbaise implied, try to publish those corporate artifacts to your corporate Maven repository (Nexus, Artifactory, Archiva, etc.), even an FTP/HTTP server would do...
Once you publish those corporate artifacts to your "corporate" repository(hopefully it's already in place), you just need a new repository declaration in your Maven POM.

Could not resolve dependencies for project from workspace

Hi I have a problem with maven. I want to run my app but when I am typing "clean install jetty:run" I am getting this error:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building frontend 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for laud.b2b:logic:jar:0.0.1-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.585s
[INFO] Finished at: Sat Jul 13 20:17:27 CEST 2013
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Frontend: Could not resolve dependencies for project laud.b2b:Frontend:war:0.0.1-SNAPSHOT: Failure to find laud.b2b:logic:jar:0.0.1-SNAPSHOT in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
"logic" is a second project in my workspace.
I don`t know what to do to resolve this error. I've searched whole internet and I can do nothing with it...
My pom.xml from Frontend 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>laud.b2b-root</artifactId>
<groupId>laud.b2b</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>laud.b2b</groupId>
<artifactId>Frontend</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>frontend</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.1.0</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
For widgetset compilation, vaadin-client-compiler is automatically added
on the compilation classpath by vaadin-maven-plugin so normally there is
no need for an explicit dependency. -->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>laud.b2b</groupId>
<artifactId>logic</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>ru.xpoft.vaadin</groupId>
<artifactId>spring-vaadin-integration</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>compile-widgetset</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
<!-- directory is cleaned properly -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/widgetsets</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<!-- <runTarget>mobilemail</runTarget> -->
<!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
way compatible with Vaadin eclipse plugin. -->
<webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
<hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
<noServer>true</noServer>
<!-- Remove draftCompile when project is ready -->
<draftCompile>false</draftCompile>
<compileReport>true</compileReport>
<style>OBF</style>
<strict>true</strict>
<runTarget>http://localhost:8080/</runTarget>
</configuration>
<executions>
<execution>
<configuration></configuration>
<goals>
<goal>clean</goal>
<goal>resources</goal>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile-theme</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
</configuration>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<versionRange>[7.1.0,)</versionRange>
<goals>
<goal>resources</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
(AD2)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building frontend 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # Frontend ---
[INFO] Deleting C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # Frontend ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # Frontend ---
[INFO] Compiling 2 source files to C:\Users\mateu\git\LPMavenProblem\laud\laud.b2b-root\Frontend\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
C:\Program Files (x86)\Java\jre7\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.744s
[INFO] Finished at: Sat Jul 13 21:13:52 CEST 2013
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Frontend: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files (x86)\Java\jre7\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Most probably you haven't installed all the dependencies you need to build the frontend artifact. If frontend depends on laud.b2b.logic, you must first install this artifact to your local repository before you can build artifacts that depend on it, i.e.:
Go to the logic source tree and execute mvn install
Then go to the frontend and try the build process again
Maybe it's a good idea to create a root pom.xml for all sub-projects and specify them as modules, then start the build process from the new root project. Maven will compile and install them in the correct order.
References:
Multi-module projects in Maven

Maven: Making Jars With Dependencies: Example From Book Doesn't Work

I am a complete beginner with Maven. I've been following the book Maven By Example. In the section 6.13 the author demonstrates making a JAR with the dependencies included via the command
mvn install assembly assembly
I followed the example in chapter 6, except I skipped the parts with unit testing. I went back through them to make sure I didn't skip a step. However when I tried the above command I got this error output:
[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) # simple-weather ---
[INFO]
[INFO] <<< maven-assembly-plugin:2.2-beta-5:assembly (default-cli) # simple-weather <<<
[INFO]
[INFO] --- maven-assembly-plugin:2.2-beta-5:assembly (default-cli) # simple-weather ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.094s
[INFO] Finished at: Wed Mar 21 15:53:03 EDT 2012
[INFO] Final Memory: 5M/10M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:assembly (default-cli) on project simple-weather: Error readi
ng assemblies: No assembly descriptors found. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
C:\home\Projects\simple-weather>
The problem is with the jar-with-dependencies descriptor in the plugins section. I googled around a bit, but didn't find a different way to do it from the book. So, I would be interested to know where I am going wrong.
Here is 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>org.sonatype.mavenbook.custom</groupId>
<artifactId>simple-weather</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>simple-weather</name>
<url>http://www.sonatype.com</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<organization>
<name>Sonatype</name>
<url>http://www.sonatype.com</url>
</organization>
<developers>
<developer>
<id>jason</id>
<name>Jason Van Zyl</name>
<email>jason#maven.org</email>
<url>http://www.sonatype.com</url>
<organization>Sonatype</organization>
<organizationUrl>http://www.sonatype.com</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>-6</timezone>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Thanks much in advance for any clues.
The problem is you have your descriptor refs configured for the compile plugin instead of the assembly plugin.
Add this to your /build/plugins section
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
and remove the below from your compiler plugin config as it is not doing anything.
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>

Resources