如何将javax.annotation.Generated添加到Java SE 5? [英] How do I add javax.annotation.Generated to Java SE 5?

查看:105
本文介绍了如何将javax.annotation.Generated添加到Java SE 5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个必须在Java SE 5和Java SE 6上运行的项目.我最近开始使用一种工具,该工具将@Generated批注添加到生成的代码中,并且我希望保留这些批注.看起来javax.annotation.Generated在Java 5 EE和 Java 6 SE及更高版本中,但在Java 5 SE中却没有API.

I'm working on a project that has to run on Java SE 5 and Java SE 6. I recently started using a tool that adds @Generated annotations to generated code, and I want to keep those annotations. It looks like javax.annotation.Generated is in Java 5 EE and Java 6 SE and later, but is not in the Java 5 SE API.

javax.annotation.Generated发送给客户时最好的方法是什么,这样它就可以在Java SE 5和Java SE 6上运行而不会出现任何问题?我是否只需要包含一个额外的jarfile?如果是,@Generated住哪一个?

What's the best way to include javax.annotation.Generated when I send it to the customer, so it will run on both Java SE 5 and Java SE 6 without any problems? Do I just need to include an extra jarfile? If so, which one does @Generated live in?

推荐答案

您可以从Maven中央存储库(javax.annotation.Generated以及该软件包中的其他各种类. maven.org/maven2/org/glassfish/javax.annotation/"rel =" noreferrer>此位置.您只需下载JAR,就无需使用Maven来获取它们.

You can get javax.annotation.Generated, along with various other classes from that package, from the Maven central repo at this location. You can just download the JARs, you don't need to use Maven to get them.

GrepCode 表示感谢.

这篇关于如何将javax.annotation.Generated添加到Java SE 5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆