Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven

 
Sakiw Nila
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi peeps,

Im trying to make a simple java EE6 application. But i get a error while compiling. Can anyone help me. The error looks like this.

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project primetest: Compilation failure: Compilation failure:
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\AutoCompleteBean.java:[6,30] package javax.enterprise.inject does not exist
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\AutoCompleteBean.java:[8,1] cannot find symbol
[ERROR] symbol: class Model
[ERROR] @Model
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\DateBean.java:[5,30] package javax.enterprise.inject does not exist
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\DateBean.java:[7,1] cannot find symbol
[ERROR] symbol: class Model
[ERROR] @Model
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\GreetingBean.java:[3,30] package javax.enterprise.inject does not exist
[ERROR] \Java_Projecten\primetest\src\main\java\com\examples\greeting\GreetingBean.java:[5,1] cannot find symbol
[ERROR] symbol: class Model
[ERROR] @Model


I allready used the two methods beneath in mine project POM ->

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<executable><!-- path-to-javac --></executable>
<compilerVersion>1.6</compilerVersion>
</configuration>

And this ->

<build>
[...]
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
[...]
</build>
 
Ernesto Elias-Nieland
Ranch Hand
Posts: 53
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you are missing the dependencies on these classes in your pom file. You have to add the required jar files for a project in the dependencies section of the pom.

This is similar to setting the classpath variable when you compile the code with a javac command. (Please check the maven docs for a better explanation of this. )

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you want one of these in your dependencies: http://repo1.maven.org/maven2/javax/enterprise/cdi-api/
If you can't figure out the exact dependency notation, let us know.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic