一份可以发布到MAVEN中央仓库的POM

今天在家折腾了一下怎么把Jar包发布到Maven的中央仓库,基本步骤百毒一堆,但基本上都是让引用sonatype的parent pom,个人感觉这份pom并不好用,于是自己写了一个,同时这个pom也是Spring MVC + Hibernate + Spring Security开发的基本pom,有兴趣的童鞋可以参考一下。

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>net.eulerframework</groupId>

<artifactId>euler-framework-parent</artifactId>

<version>0.0.1-SNAPSHOT</version>

<packaging>pom</packaging>

<name>net.eulerframework:euler-framework-parent</name>

<url>http://www.eulerproject.io</url>

<description>Parent POM for Euler Framework projects.</description>

<profiles>

<!-- <profile>

<id>java8-doclint-disabled</id>

<activation>

<jdk>[1.8,)</jdk>

</activation>

<properties>

<javadoc.opts>-Xdoclint:none</javadoc.opts>

</properties>

</profile> -->

<profile>

<id>sonatype-oss-release</id>

<distributionManagement>

<snapshotRepository>

<id>sonatype-nexus-snapshots</id>

<name>Sonatype Nexus Snapshots</name>

<url>https://oss.sonatype.org/content/repositories/snapshots/</url>

</snapshotRepository>

<repository>

<id>sonatype-nexus-staging</id>

<name>Nexus Release Repository</name>

<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>

</repository>

</distributionManagement>

<build>

<pluginManagement>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-release-plugin</artifactId>

<version>2.1</version>

<configuration>

<mavenExecutorId>forked-path</mavenExecutorId>

<useReleaseProfile>false</useReleaseProfile>

<arguments>-Psonatype-oss-release</arguments>

</configuration>

</plugin>

</plugins>

</pluginManagement>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-enforcer-plugin</artifactId>

<version>1.0</version>

<executions>

<execution>

<id>enforce-maven</id>

<goals>

<goal>enforce</goal>

</goals>

<configuration>

<rules>

<requireMavenVersion>

<version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>

<message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message>

</requireMavenVersion>

</rules>

</configuration>

</execution>

</executions>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-source-plugin</artifactId>

<version>2.1.2</version>

<executions>

<execution>

<id>attach-sources</id>

<goals>

<goal>jar-no-fork</goal>

</goals>

</execution>

</executions>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-javadoc-plugin</artifactId>

<version>2.7</version>

<executions>

<execution>

<id>attach-javadocs</id>

<goals>

<goal>jar</goal>

</goals>

</execution>

</executions>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-gpg-plugin</artifactId>

<version>1.1</version>

<executions>

<execution>

<id>sign-artifacts</id>

<phase>verify</phase>

<goals>

<goal>sign</goal>

</goals>

</execution>

</executions>

</plugin>

</plugins>

</build>

</profile>

<profile>

<id>repo-eulerproject-release</id>

<distributionManagement>

<repository>

<id>releases</id>

<url>http://repo.eulerproject.io/content/repositories/maven-releases/</url>

</repository>

<snapshotRepository>

<id>snapshots</id>

<url>http://repo.eulerproject.io/content/repositories/maven-snapshots/</url>

</snapshotRepository>

</distributionManagement>

<build>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-source-plugin</artifactId>

<version>3.0.1</version>

<executions>

<execution>

<id>attach-sources</id>

<goals>

<goal>jar-no-fork</goal>

</goals>

</execution>

</executions>

</plugin>

<!-- <plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-javadoc-plugin</artifactId>

<version>2.10.4</version>

<executions>

<execution>

<id>attach-javadocs</id>

<goals>

<goal>jar</goal>

</goals>

<configuration>

<additionalparam>${javadoc.opts}</additionalparam>

</configuration>

</execution>

</executions>

</plugin> -->

</plugins>

</build>

</profile>

</profiles>

<properties>

<jdk.version>1.7</jdk.version>

<commons-codec.version>1.10</commons-codec.version>

<jsp.version>2.2</jsp.version>

<servlet.version>3.0.1</servlet.version>

<jstl.version>1.2</jstl.version>

<inject.version>1</inject.version>

<validation-api.version>1.1.0.Final</validation-api.version>

<jta.version>1.1</jta.version>

<jaxb-api.version>2.2.12</jaxb-api.version>

<java-mail.version>1.5.5</java-mail.version>

<springframework.version>4.2.5.RELEASE</springframework.version>

<springsecurity.version>4.0.4.RELEASE</springsecurity.version>

<springsecurity.oauth.version>2.0.9.RELEASE</springsecurity.oauth.version>

<springsecurity.oauth.jwt.version>1.0.4.RELEASE</springsecurity.oauth.jwt.version>

<AspectJ.version>1.8.9</AspectJ.version>

<jasig.version>3.2.2</jasig.version>

<quartz.version>2.2.3</quartz.version>

<hibernate.version>5.0.5.Final</hibernate.version>

<hibernate.validator.version>5.2.4.Final</hibernate.validator.version>

<c3p0.version>0.9.5.2</c3p0.version>

<mysqljdbc.version>5.1.38</mysqljdbc.version>

<!-- <jersey.version>2.22.2</jersey.version> -->

<jackson.version>2.7.3</jackson.version>

<slf4j-api.version>1.7.21</slf4j-api.version>

<log4j.version>1.2.17</log4j.version>

<log4j2.version>2.5</log4j2.version>

<jboss.logging.version>3.3.0.Final</jboss.logging.version>

<commons-logging.version>1.2</commons-logging.version>

<junit.version>3.8.1</junit.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

</properties>

<dependencyManagement>

<dependencies>

<!-- Basic Jars -->

<dependency>

<groupId>commons-codec</groupId>

<artifactId>commons-codec</artifactId>

<version>${commons-codec.version}</version>

</dependency>

<!-- J2EE -->

<dependency>

<groupId>javax.servlet</groupId>

<artifactId>javax.servlet-api</artifactId>

<version>${servlet.version}</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>javax.servlet.jsp</groupId>

<artifactId>jsp-api</artifactId>

<version>${jsp.version}</version>

<scope>provided</scope>

</dependency>

<dependency>

<groupId>javax.servlet</groupId>

<artifactId>jstl</artifactId>

<version>${jstl.version}</version>

</dependency>

<dependency>

<groupId>javax.inject</groupId>

<artifactId>javax.inject</artifactId>

<version>${inject.version}</version>

</dependency>

<dependency>

<groupId>javax.validation</groupId>

<artifactId>validation-api</artifactId>

<version>${validation-api.version}</version>

</dependency>

<dependency>

<groupId>javax.transaction</groupId>

<artifactId>jta</artifactId>

<version>${jta.version}</version>

</dependency>

<dependency>

<groupId>javax.xml.bind</groupId>

<artifactId>jaxb-api</artifactId>

<version>${jaxb-api.version}</version>

</dependency>

<dependency>

<groupId>javax.mail</groupId>

<artifactId>javax.mail-api</artifactId>

<version>${java-mail.version}</version>

</dependency>

<!-- Spring -->

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-context-support</artifactId>

<version>${springframework.version}</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-webmvc</artifactId>

<version>${springframework.version}</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-orm</artifactId>

<version>${springframework.version}</version>

</dependency>

<dependency>

<groupId>org.springframework</groupId>

<artifactId>spring-oxm</artifactId>

<version>${springframework.version}</version>

</dependency>

<dependency>

<groupId>org.aspectj</groupId>

<artifactId>aspectjweaver</artifactId>

<version>${AspectJ.version}</version>

</dependency>

<dependency>

<groupId>org.quartz-scheduler</groupId>

<artifactId>quartz</artifactId>

<version>${quartz.version}</version>

<exclusions>

<exclusion>

<groupId>c3p0</groupId>

<artifactId>c3p0</artifactId>

</exclusion>

<exclusion>

<groupId>org.slf4j</groupId>

<artifactId>slf4j-api</artifactId>

</exclusion>

</exclusions>

</dependency>

<!-- Spring Security -->

<dependency>

<groupId>org.springframework.security</groupId>

<artifactId>spring-security-core</artifactId>

<version>${springsecurity.version}</version>

</dependency>

<dependency>

<groupId>org.springframework.security</groupId>

<artifactId>spring-security-web</artifactId>

<version>${springsecurity.version}</version>

</dependency>

<dependency>

<groupId>org.springframework.security</groupId>

<artifactId>spring-security-taglibs</artifactId>

<version>${springsecurity.version}</version>

</dependency>

<dependency>

<groupId>org.springframework.security</groupId>

<artifactId>spring-security-config</artifactId>

<version>${springsecurity.version}</version>

</dependency>

<!-- Spring Security LDAP -->

<dependency>

<groupId>org.springframework.security</groupId>

<artifactId>spring-security-ldap</artifactId>

<version>${springsecurity.version}</version>

</dependency>

<!-- Spring Security CAS -->

<dependency>

<groupId>org.springframework.security</groupId>

<artifactId>spring-security-cas</artifactId>

<version>${springsecurity.version}</version>

</dependency>

<dependency>

<groupId>org.jasig.cas.client</groupId>

<artifactId>cas-client-core</artifactId>

<version>${jasig.version}</version>

<exclusions>

<exclusion>

<groupId>commons-logging</groupId>

<artifactId>commons-logging</artifactId>

</exclusion>

</exclusions>

</dependency>

<!-- Spring Security OAuth2.0 -->

<dependency>

<groupId>org.springframework.security.oauth</groupId>

<artifactId>spring-security-oauth2</artifactId>

<version>${springsecurity.oauth.version}</version>

</dependency>

<dependency>

<groupId>org.springframework.security</groupId>

<artifactId>spring-security-jwt</artifactId>

<version>${springsecurity.oauth.jwt.version}</version>

</dependency>

<!-- Hibernate ... -->

<dependency>

<groupId>org.hibernate</groupId>

<artifactId>hibernate-core</artifactId>

<version>${hibernate.version}</version>

</dependency>

<dependency>

<groupId>org.hibernate</groupId>

<artifactId>hibernate-validator</artifactId>

<version>${hibernate.validator.version}</version>

</dependency>

<dependency>

<groupId>com.mchange</groupId>

<artifactId>c3p0</artifactId>

<version>${c3p0.version}</version>

</dependency>

<dependency>

<groupId>mysql</groupId>

<artifactId>mysql-connector-java</artifactId>

<version>${mysqljdbc.version}</version>

</dependency>

<!-- Jersey bean-validator与Hibernate5冲突 -->

<!-- <dependency>

<groupId>org.glassfish.jersey.containers</groupId>

<artifactId>jersey-container-servlet</artifactId>

<version>${jersey.version}</version>

</dependency>

<dependency>

<groupId>org.glassfish.jersey.ext</groupId>

<artifactId>jersey-spring3</artifactId>

<version>${jersey.version}</version>

<exclusions>

<exclusion>

<groupId>org.glassfish.hk2.external</groupId>

<artifactId>bean-validator</artifactId>

</exclusion>

</exclusions>

</dependency>

<dependency>

<groupId>org.glassfish.jersey.media</groupId>

<artifactId>jersey-media-json-jackson</artifactId>

<version>${jersey.version}</version>

</dependency> -->

<!-- Jackson -->

<dependency>

<groupId>com.fasterxml.jackson.core</groupId>

<artifactId>jackson-core</artifactId>

<version>${jackson.version}</version>

</dependency>

<dependency>

<groupId>com.fasterxml.jackson.core</groupId>

<artifactId>jackson-databind</artifactId>

<version>${jackson.version}</version>

</dependency>

<dependency>

<groupId>com.fasterxml.jackson.core</groupId>

<artifactId>jackson-annotations</artifactId>

<version>${jackson.version}</version>

</dependency>

<dependency>

<groupId>com.fasterxml.jackson.datatype</groupId>

<artifactId>jackson-datatype-jsr310</artifactId>

<version>${jackson.version}</version>

</dependency>

<!-- Too many loggers ... -->

<dependency>

<groupId>org.slf4j</groupId>

<artifactId>slf4j-api</artifactId>

<version>${slf4j-api.version}</version>

</dependency>

<dependency>

<groupId>org.apache.logging.log4j</groupId>

<artifactId>log4j-core</artifactId>

<version>${log4j2.version}</version>

</dependency>

<dependency>

<groupId>log4j</groupId>

<artifactId>log4j</artifactId>

<version>${log4j.version}</version>

</dependency>

<dependency>

<groupId>org.jboss.logging</groupId>

<artifactId>jboss-logging</artifactId>

<version>${jboss.logging.version}</version>

</dependency>

<dependency>

<groupId>commons-logging</groupId>

<artifactId>commons-logging</artifactId>

<version>${commons-logging.version}</version>

</dependency>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>${junit.version}</version>

<scope>test</scope>

</dependency>

</dependencies>

</dependencyManagement>

<build>

<pluginManagement>

<plugins>

<!-- This plugin‘s configuration is used to store Eclipse

m2e settings only. It has no influence on the Maven build itself. -->

<plugin>

<groupId>org.eclipse.m2e</groupId>

<artifactId>lifecycle-mapping</artifactId>

<version>1.0.0</version>

<configuration>

<lifecycleMappingMetadata>

<pluginExecutions>

<pluginExecution>

<pluginExecutionFilter>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-enforcer-plugin</artifactId>

<versionRange>[1.0.0,)</versionRange>

<goals>

<goal>enforce</goal>

</goals>

</pluginExecutionFilter>

<action>

<ignore />

</action>

</pluginExecution>

</pluginExecutions>

</lifecycleMappingMetadata>

</configuration>

</plugin>

</plugins>

</pluginManagement>

<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.3</version>

<configuration>

<source>${jdk.version}</source>

<target>${jdk.version}</target>

</configuration>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-resources-plugin</artifactId>

<version>2.7</version>

<configuration>

<encoding>UTF-8</encoding>

</configuration>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-jar-plugin</artifactId>

<version>2.6</version>

<configuration>

<archive>

<addMavenDescriptor>false</addMavenDescriptor>

</archive>

</configuration>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-war-plugin</artifactId>

<version>2.6</version>

<configuration>

<archive>

<addMavenDescriptor>false</addMavenDescriptor>

</archive>

</configuration>

</plugin>

</plugins>

</build>

<licenses>

<license>

<name>MIT License</name>

<url>https://opensource.org/licenses/MIT</url>

</license>

</licenses>

<scm>

<connection>https://github.com/euler-projects/euler-framework.git</connection>

<developerConnection>[email protected]:euler-projects/euler-framework.git</developerConnection>

<url>https://github.com/euler-projects/euler-framework</url>

</scm>

<developers>

<developer>

<name>cFrost Sun</name>

<email>[email protected]</email>

<organization>euler-project</organization>

<organizationUrl>https://eulerproject.io</organizationUrl>

</developer>

</developers>

</project>

更多关于Euler Framework的资料请访问eulerproject.io

时间: 2024-11-25 10:56:46

一份可以发布到MAVEN中央仓库的POM的相关文章

喜大普奔,微软Microsoft JDBC Driver For SQL Server已发布到maven中央仓库

相信通过java和SQLServer开发应用的同学们都经历过如下类似的问题. 微软提供的JDBC官方驱动没有放置在Maven仓库中,这样如果你的Java应用需要访问SQL Server,你不得不下载sqljdbc4.jar至本地,然后每次都通过如下Maven命令安装这一驱动: mvn install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar

Dev 日志 | 如何将 jar 包发布到 Maven 中央仓库

摘要 Maven 中央仓库并不支持直接上传?jar?包,因此需要将 jar?包发布到一些指定的第三方?Maven?仓库,比如:Sonatype OSSRH 仓库,然后该仓库再将 jar?包同步到?Maven?,本文详细记录整个发布.同步过程. 注册一个 Sonatype 用户 进入地址:https://issues.sonatype.org/secure/Signup!default.jspa?注册 Sonatype 用户,Sonatype 通过 JIRA(JIRA 是 Atlassian 公司

将 jar 包发布到Maven中央仓库

这里列出一些发布过程中的注意点: 1. javadocs 的验证非常严格,在上传 javadoc 时需要做降级处理,关闭doclint.maven plugin 配置如下: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.9.1</version> &l

向maven中央仓库提交jar

从来都是从中央仓库下载jar,这次需要向中央仓库提交jar, 利用Sonatype OSSRH可以把jar等资源提交给Maven的中央仓库. Sonatype OSSRH介绍: Sonatype OSSRH使用Nexus 为开源项目提供仓库管理服务,该仓库就是所谓maven的中央仓库,OSSRH允许我们向Maven中央仓库提交二进制文件. 1:提交(deploy)开发版本的二进制文件(snapshorts) 2: 阶段性的发布版本 3:发布一个release,然后同步他们到中央仓库. 初始阶段

Maven中央仓库地址整理

最近做项目的时候,一直发现常用的oschina maven源一直都没有反应,后面发现原来oschina竟然关闭了maven源服务,后面经同事推荐了阿里云的maven源,这速度杠杠的 Maven 中央仓库地址: 1.http://www.sonatype.org/nexus/  私服nexus工具使用2.http://mvnrepository.com/ (推荐) 3.http://repo1.maven.org/maven2 4.http://maven.aliyun.com/nexus/con

libvirt最新版本未deploy到maven中央仓库

libvirt是虚拟化API. org.libvirt:libvirt:jar是其java实现. 官网:http://libvirt.org/ 在中央仓库搜索,其最高版本为0.4.7,可是现实情况这个不是最新版本(发现有人在用0.4.9版本) 通过查看其官网,在http://libvirt.org/java.html页面获得相关信息: MavenUp until version 0.4.7 the Java bindings were available from the central mav

maven中央仓库

<mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> <mirror> <id>central</id

maven中央仓库的配置在哪里?superpom是什么?中央仓库查找三方包

maven的superpom 每个项目都默认继承的pom 位置 $M2_HOME/lib/maven-model-builder.jar 使用tar -xvf解压后,grep -r central 搜索解压后的目录 中央仓库的默认值 id为central:地址为https://repo.maven.apache.org/maven2/ 中央仓库搜索三方包 https://search.maven.org/ 原文地址:https://www.cnblogs.com/shengulong/p/111

Maven 中央仓库

概述 当你建立一个 Maven 的项目,Maven 会检查你的 pom.xml 文件,以确定哪些依赖下载.首先,Maven 将从本地资源库获得 Maven 的本地资源库依赖资源,如果没有找到,然后把它会从默认的 Maven 中央存储库 http://repo1.maven.org/maven2/ 查找下载. 使用 MVNrepository 搜索:https://mvnrepository.com/ 原文地址:https://www.cnblogs.com/bjio/p/11681938.htm