Eclipse not picking up maven Managed Dependencies [message #941237] |
Fri, 12 October 2012 10:20 |
David Weber Messages: 1 Registered: October 2012 Location: Zurich |
Junior Member |
|
|
I'm trying to create an application with Scout that is built with maven.
Therefore, I first followed the tutorial to create the minicrm (http://wiki.eclipse.org/Scout/Tutorial/3.8/Minicrm/Minicrm_Step-by-Step) and then I followed the Maven Tycho Build tutorial (http://wiki.eclipse.org/Scout/Tutorial/3.8/Maven_Tycho_Build).
At the moment I have the minicrm application that works fine when I start it in eclipse and the maven build is working as well.
I am using:
- Eclipse Juno Service Release 1 (Eclipse for Scout Developers, RCP Version 4.2.1.M20120914-1800, Scout Version 3.8.1.201209171521)
- Maven Integration for Eclipse (Version 1.2.020120903-1050)
- Tycho Project Configurators (Version 0.6.0.201207302152)
- Apache Maven 3.0.4
- Java 1.7.0_04
- Windows 7, Version 6.1, Arch: Amd64
Now I want to add additional maven dependencies to my minicrm.server pom.xml.
E.g. log4j dependency for logging:
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
Unfortunately, the dependencies that I add are not recognized by eclipse.
I would expect them to appear in a "Maven dependency" project tree node similar to "Plug-in Dependencies" but the project does not contain such a node.
When I try to add for example the log4j Logger in the StandardOutlineService the class is not recognized.
import org.apache.log4j.Logger;
...
private Logger logger = Logger.getLogger(this.getClass().getName());
I already tried a "Maven - Update Project..." from the context menu. Could there be a problem between the m2eclipse Plugin and the plugin created with Scout or did I forget something? I would at least expect that the maven build still works but when I add the Logger and its import statement and run a "mvn clean install" the build fails as well.
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.15.0:co
mpile (default-compile) on project org.eclipse.minicrm.server: Compilation failu
re: Compilation failure:
[ERROR] C:\local\eclipse\workspace_scout2\org.eclipse.minicrm.server\src\org\ecl
ipse\minicrm\server\services\outline\StandardOutlineService.java:[11,0]
[ERROR] import org.apache.log4j.Logger;
[ERROR] ^^^^^^^^^^^^^^^^
[ERROR] The import org.apache.log4j cannot be resolved
[ERROR] C:\local\eclipse\workspace_scout2\org.eclipse.minicrm.server\src\org\ecl
ipse\minicrm\server\services\outline\StandardOutlineService.java:[16,0]
[ERROR] private Logger logger = Logger.getLogger(this.getClass().getName());
[ERROR] ^^^^^^
[ERROR] Logger cannot be resolved to a type
[ERROR] C:\local\eclipse\workspace_scout2\org.eclipse.minicrm.server\src\org\ecl
ipse\minicrm\server\services\outline\StandardOutlineService.java:[16,0]
[ERROR] private Logger logger = Logger.getLogger(this.getClass().getName());
[ERROR] ^^^^^^
[ERROR] Logger cannot be resolved
I just found one similar post in the Newcomers forum (http://www.eclipse.org/forums/index.php/m/793812/?srch=new+maven+dependency#msg_793812) but there was no answer.
The pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation=...
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.minicrm</groupId>
<artifactId>org.eclipse.minicrm</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../org.eclipse.minicrm/</relativePath>
</parent>
<artifactId>org.eclipse.minicrm.server</artifactId>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</project>
The .project file:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.minicrm.server</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.scout.sdk.ScoutNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
[Updated on: Fri, 12 October 2012 10:22] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02845 seconds