Friday, June 13, 2014

Force Maven Project to use JRE/JDK 7

The Issue

When I cloned the AngularJS Seed project from GitHub, and imported to eclipse, the project will use JRE 1.5.

The Solution

The problem is that pom.xml file did not provide the maven compile plugin.

Here is the update version of pom.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!--xml version="1.0" encoding="UTF-8"?-->
 <modelversion>4.0.0</modelversion>
 
 <groupid>angularjs-maven-tomcat-seed</groupid>
 <artifactid>angularjs-maven-tomcat-seed</artifactid>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>war</packaging>
 
 
 <build>
  <!-- To define the plugin version in your parent POM -->
  <pluginmanagement>
   <plugins>
    <plugin>
     <groupid>org.apache.tomcat.maven</groupid>
     <artifactid>tomcat7-maven-plugin</artifactid>
     <version>2.2</version>
    </plugin>
   </plugins>
  </pluginmanagement>
  <!-- To use the plugin goals in your POM or parent POM -->
  <plugins>
   <plugin>
    <artifactid>maven-compiler-plugin</artifactid>
    <version>2.3.2</version>
    <executions>
     <execution>
      <id>default-testCompile</id>
      <phase>test-compile</phase>
      <goals>
       <goal>testCompile</goal>
      </goals>
      <configuration>
       <source>1.7
       <target>1.7</target>
       <encoding>UTF-8</encoding>
      </configuration>
     </execution>
     <execution>
      <id>default-compile</id>
      <phase>compile</phase>
      <goals>
       <goal>compile</goal>
      </goals>
      <configuration>
       <source>1.7
       <target>1.7</target>
       <encoding>UTF-8</encoding>
      </configuration>
     </execution>
    </executions>
    <configuration>
     <source>1.7
     <target>1.7</target>
     <encoding>UTF-8</encoding>
    </configuration>
   </plugin>
   <plugin>
    <groupid>org.apache.tomcat.maven</groupid>
    <artifactid>tomcat7-maven-plugin</artifactid>
    <version>2.2</version>
   </plugin>
  </plugins>
 </build>
</project>

Anypoint Studio Error: The project is missing Munit lIbrary to run tests

Anypoint Studio 7.9 has a bug. Even if we following the article: https://help.mulesoft.com/s/article/The-project-is-missing-MUnit-libraries-...