开发者

Why I can't use Spring and Blossom annotations?

I use Magnolia CMS and Blossom.

When I add annotations to my classes I get something like this:

annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations)

@Template(value="Blossom Template")*

Spring annotation(like @Con开发者_StackOverflow社区troller) doesn't compile too. Where is my mistake?

My pom.xml dependencies:

<dependencies>
    <dependency>
        <groupId>info.magnolia</groupId>
        <artifactId>magnolia-module-blossom</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>info.magnolia</groupId>
        <artifactId>magnolia-module-admininterface</artifactId>
        <version>4.3.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>info.magnolia</groupId>
        <artifactId>magnolia-taglib-cms</artifactId>
        <version>4.3.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>info.magnolia</groupId>
        <artifactId>magnolia-taglib-utility</artifactId>
        <version>4.3.5</version>
        <scope>provided</scope>
    </dependency>
</dependencies>


You have to change your maven.compiler properties to compile with java 1.5.

<properties>
    <!-- maven-compiler-plugin configuration -->
    <maven.compiler.source>1.5</maven.compiler.source>
    <maven.compiler.target>1.5</maven.compiler.target>
</properties>

Another way to do this (but less discreet) is this :

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>2.3.1</version>
  <configuration>
    <source>1.5</source>
    <target>1.5</target>
  </configuration>
</plugin>

Resources :

  • http://maven.apache.org/ - compile MoJo - Source

On the same topic :

  • How can I force maven to package my project against 1.5?


I am happy this got answered but encourage you to use the Magnolia community, especially the mailing-list to ask questions about Magnolia in the future. This will benefit you and the community.

See http://www.magnolia-cms.com/home/community/mailing-lists.html

Thanks - Boris

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜