Before you can build a Java EE project with Maven, you need to add the Java EE dependencies. And you need to tell Maven where to find the repositories for the Java EE artifacts.
-
For JDK 5 & Java EE 5:
~/.m2/settings.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>DefaultProfile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/1/</url>
<layout>legacy</layout>
</repository>
</repositories>
</profile>
</profiles>
</settings>
pom.xml
:
<dependencies>
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<version>5</version>
<scope>provided</scope>
</dependency>
</dependencies>
-
For JDK 6 & Java EE 6:
~/.m2/settings.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<profiles>
<profile>
<id>DefaultProfile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
</profile>
</profiles>
</settings>
pom.xml
:
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
分享到:
相关推荐
javaEE6jar包
java ee 开发中用到的jar包集合,版本为 javaee6 下载可以直接使用
maven依赖中版本统一,下载之后无需再手动找寻maven所需要的常用依赖,资源包中包含较全,方便用户的使用。
主要介绍了maven中只有Lifecycle而Dependencies和Plugins消失的问题及解决方法,本文通过图文的形式给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧
Java App示例这个程序是通过Quarkus生成的: mvn io.quarkus:quarkus-maven-plugin:1.10.3.Final:create \ -DprojectGroupId=org.acme \ -DprojectArtifactId=getting-started \ -DclassName="org.acme.getting....
hive 开发UDF 使用maven工程 引发jar包缺失 hive 开发UDF 使用maven工程 引发jar包缺失
这是一个maven依赖+继承+聚合的小例子,用来参考和学习maven
反向依赖-maven-plugin 反向依赖 Maven 插件
If you are working with Java or Java EE projects and you want to take advantage of Maven dependency management, then this book is ideal for you. This book is also particularly useful if you are a ...
java-dependencies-analysis 分析项目开发中的开放源代码... buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "gradle.plugin.com.github.pt-osda.java
基于Maven的javax.mail发送邮件例子程序 pom.xml添加依赖jar: <dependencies> <groupId>javax.mail <artifactId>mail ${javamail.version} </dependency> </dependencies> <javamail.version>1.4.1 ...
Dependencies-for-win10主要是在win10系统下比较好用的一款自研工具,比官方的工具相对来水流畅,分析效率更高
以前的Dependencies在win10已经不能满足需求,每次打开都特别慢,在github上找了下类型的工具,终于搜到源码,编译到了最终的成果物,注意在win10体验最佳,需要4.6.1的环境
然后再在项目test上点右键选择 Maven2 ->add dependency 在新对话框里的Query输入junit 然后在下面的Search Results 里 展开junit 选择 "3.8.1 - junit-3.8.1.jar ............"这一项。然后点ok. 然后等一会。我们...
The Assembly Plugin for Maven is primarily intended to allow users to aggregate the project output along with its dependencies, modules, site documentation, and other files into a single distributable...
Add library to project dependencies. repositories { maven { url "https://jitpack.io" } } dependencies { // snapshot version compile '...
自从Java诞生以来,打包,测试,代码检测和发布Java工程就成为困扰Java程序员的枷锁,即使Ant出现,程序员深受困扰,而且Ant的 Xml格式的Build文件的学习阶梯又给程序员加重了一层负担.程序员头顶上的天空依然阴霾,只到有...
Maven权威指南 Authors Tim O'Brien (Sonatype, Inc.) , John Casey (Sonatype, Inc.) , Brian Fox (Sonatype, Inc.) , Bruce Snyder () , Jason Van Zyl (Sonatype, Inc.) , Juven Xu () Abstract Maven权威指南...
mvn se.vandmo:dependency-lock-maven-plugin:lock将创建一个dependencies-lock.json文件。 然后,您应该将该文件提交给您选择的源控件。 如果某些依赖项是同一多模块项目的一部分,则您可能希望这些依赖项与锁定...