由于提供给开发人员的jar包没有源码,只有class文件,没有源码导致注释都看不到,所以需要打源码包上传值nexus私服。

maven配置文件settings.xml配置如下:

<?xml version="1.0" encoding="UTF-8"?><!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
--><!--| This is the configuration file for Maven. It can be specified at two levels:||  1. User Level. This settings.xml file provides configuration for a single user,|                 and is normally provided in ${user.home}/.m2/settings.xml.||                 NOTE: This location can be overridden with the CLI option:||                 -s /path/to/user/settings.xml||  2. Global Level. This settings.xml file provides configuration for all Maven|                 users on a machine (assuming they're all using the same Maven|                 installation). It's normally provided in|                 ${maven.conf}/settings.xml.||                 NOTE: This location can be overridden with the CLI option:||                 -gs /path/to/global/settings.xml|| The sections in this sample file are intended to give you a running start at| getting the most out of your Maven installation. Where appropriate, the default| values (values used when the setting is not specified) are provided.||-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><!-- localRepository| The path to the local repository maven will use to store artifacts.|| Default: ${user.home}/.m2/repository<localRepository>/path/to/local/repo</localRepository>--><!-- interactiveMode| This will determine whether maven prompts you when it needs input. If set to false,| maven will use a sensible default value, perhaps based on some other setting, for| the parameter in question.|| Default: true<interactiveMode>true</interactiveMode>--><!-- offline| Determines whether maven should attempt to connect to the network when executing a build.| This will have an effect on artifact downloads, artifact deployment, and others.|| Default: false<offline>false</offline>--><!-- pluginGroups| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.|--><pluginGroups><!-- pluginGroup| Specifies a further group identifier to use for plugin lookup.<pluginGroup>com.your.plugins</pluginGroup>--></pluginGroups><!-- proxies| This is a list of proxies which can be used on this machine to connect to the network.| Unless otherwise specified (by system property or command-line switch), the first proxy| specification in this list marked as active will be used.|--><proxies><!-- proxy| Specification for one proxy, to be used in connecting to the network.|<proxy><id>optional</id><active>true</active><protocol>http</protocol><username>proxyuser</username><password>proxypass</password><host>proxy.host.net</host><port>80</port><nonProxyHosts>local.net|some.host.com</nonProxyHosts></proxy>--></proxies><!-- servers| This is a list of authentication profiles, keyed by the server-id used within the system.| Authentication profiles can be used whenever maven must make a connection to a remote server.|--><servers><!-- server| Specifies the authentication information to use when connecting to a particular server, identified by| a unique name within the system (referred to by the 'id' attribute below).|| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are|       used together.|<server><id>deploymentRepo</id><username>repouser</username><password>repopwd</password></server>--><!-- Another sample, using keys to authenticate.<server><id>siteServer</id><privateKey>/path/to/private/key</privateKey><passphrase>optional; leave empty if not used.</passphrase></server>--><server>  <id>snapshots</id>  <username>admin</username>  <password>fwk123</password>  </server> <server>  <id>releases</id>  <username>admin</username>  <password>fwk123</password>  </server></servers><!-- mirrors| This is a list of mirrors to be used in downloading artifacts from remote repositories.|| It works like this: a POM may declare a repository to use in resolving certain artifacts.| However, this repository may have problems with heavy traffic at times, so people have mirrored| it to several places.|| That repository definition will have a unique id, so we can create a mirror reference for that| repository, to be used as an alternate download site. The mirror site will be the preferred| server for that repository.|--><mirrors><!-- mirror| Specifies a repository mirror site to use instead of a given repository. The repository that| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.|<mirror><id>mirrorId</id><mirrorOf>repositoryId</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://my.repository.com/repo/path</url></mirror>--><mirror><!-- <id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf>        --><id>nexus</id><name>my nexus</name><url>http://xxx/repository/maven-public/</url><mirrorOf>central</mirrorOf></mirror></mirrors><!-- profiles| This is a list of profiles which can be activated in a variety of ways, and which can modify| the build process. Profiles provided in the settings.xml are intended to provide local machine-| specific paths and repository locations which allow the build to work in the local environment.|| For example, if you have an integration testing plugin - like cactus - that needs to know where| your Tomcat instance is installed, you can provide a variable here such that the variable is| dereferenced during the build process to configure the cactus plugin.|| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles| section of this document (settings.xml) - will be discussed later. Another way essentially| relies on the detection of a system property, either matching a particular value for the property,| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.| Finally, the list of active profiles can be specified directly from the command line.|| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact|       repositories, plugin repositories, and free-form properties to be used as configuration|       variables for plugins in the POM.||--><profiles><!-- profile| Specifies a set of introductions to the build process, to be activated using one or more of the| mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>| or the command line, profiles have to have an ID that is unique.|| An encouraged best practice for profile identification is to use a consistent naming convention| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.| This will make it more intuitive to understand what the set of introduced profiles is attempting| to accomplish, particularly when you only have a list of profile id's for debug.|| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.<profile><id>jdk-1.4</id><activation><jdk>1.4</jdk></activation><repositories><repository><id>jdk14</id><name>Repository for JDK 1.4 builds</name><url>http://www.myhost.com/maven/jdk14</url><layout>default</layout><snapshotPolicy>always</snapshotPolicy></repository></repositories></profile>--><!--| Here is another profile, activated by the system property 'target-env' with a value of 'dev',| which provides a specific path to the Tomcat instance. To use this, your plugin configuration| might hypothetically look like:|| ...| <plugin>|   <groupId>org.myco.myplugins</groupId>|   <artifactId>myplugin</artifactId>||   <configuration>|     <tomcatLocation>${tomcatPath}</tomcatLocation>|   </configuration>| </plugin>| ...|| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to|       anything, you could just leave off the <value/> inside the activation-property.|<profile><id>env-dev</id><activation><property><name>target-env</name><value>dev</value></property></activation><properties><tomcatPath>/path/to/tomcat/instance</tomcatPath></properties></profile>--><profile>   <!--profile的id--><id>dev</id>   <repositories>   <repository>  <!--仓库id,repositories可以配置多个仓库,保证id不重复--><id>nexus</id>   <!--仓库地址,即nexus仓库组的地址--><url>http://xxx/repository/maven-public/</url>   <!--是否下载releases构件--><releases>   <enabled>true</enabled>   </releases>   <!--是否下载snapshots构件--><snapshots>   <enabled>true</enabled>   </snapshots>   </repository>   </repositories>  <pluginRepositories>  <!-- 插件仓库,maven的运行依赖插件,也需要从私服下载插件 --><pluginRepository>  <!-- 插件仓库的id不允许重复,如果重复后边配置会覆盖前边 --><id>public</id>  <name>Public Repositories</name>  <url>http://xxx/repository/maven-public/</url>  </pluginRepository>  </pluginRepositories>  </profile></profiles><!-- activeProfiles| List of profiles that are active for all builds.|<activeProfiles><activeProfile>alwaysActiveProfile</activeProfile><activeProfile>anotherAlwaysActiveProfile</activeProfile></activeProfiles>--><activeProfiles><activeProfile>dev</activeProfile></activeProfiles>
</settings>

java项目pom.xml配置如下:

<?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>com.fwkily</groupId><artifactId>jvmdemo</artifactId><version>1.0-SNAPSHOT</version><properties><java.version>1.8</java.version></properties><build><plugins>
<!-- 打源码包插件 --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><configuration><attach>true</attach></configuration><executions><execution><phase>compile</phase><goals><goal>jar</goal></goals></execution></executions></plugin>
<!-- 编译插件,不然会编译会报错 --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.8.0</version><configuration><source>1.8</source><target>1.8</target></configuration></plugin></plugins></build><repositories><repository><id>central</id><url>http://xxx/repository/maven-public/</url><snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots></repository></repositories><!-- 配置远程发布到私服,mvn deploy --><distributionManagement><!-- 定义releases库的坐标 --><repository><id>releases</id><name>Nexus Release Repository</name><url>http://xxx/repository/maven-releases/</url></repository><!-- 定义snapshots库 --><snapshotRepository><id>snapshots</id><name>Nexus Snapshot Repository</name><url>http://xxx/repository/maven-snapshots/</url></snapshotRepository></distributionManagement></project>

maven deploy jar包和源码包到私服相关推荐

  1. 【Linux/内核】Linux内核rpm包和源码包下载地址-20210107

    1.有个需求:如何下载老版本内核rpm包? 因自己在按文档做实验时,为了实验期间涉及软件包版本保持一致,需要用到旧版本的内核rpm包,但是自己在内核下载页面并没找到相关的旧版本软件包,只有最近新版本的 ...

  2. spring各版本jar包和源码

    spring各版本jar包和源码 spring历史版本源码:https://github.com/spring-projects/spring-framework/tags spring历史jar包和 ...

  3. 下载java免安装包_下载并获取免安装版的JDK、JRE和源码包

    首先,我们需要去Oracle官网下载JDK的exe安装程序,下载页面:传送门,我下载的是截至目前为止最新的JDK 8u192.接下来就有两种方式获取免安装版的JDK.JRE和源码包,第一种方式不需要打 ...

  4. linux源码编译rpm,Linux的RPM和源码包(CentOS)

    Liunx的软件包有源码包和二进制(RPM)包,源码包即是包含全部的源代码,绝大部分是使用c语言开发,其未经过编译,所以安装时要经过一系列编译,将其变成机器语言才能安装.RPM包是事先经过编译,其安装 ...

  5. linux平台下rpm方式和源码包方式安装mysql5.7

    博主QQ:819594300 博客地址:http://zpf666.blog.51cto.com/ 有什么疑问的朋友可以联系博主,博主会帮你们解答,谢谢支持! 一.下载mysql的rpm包 Mysql ...

  6. yum更换本地源、yum下载和源码包安装

    7.6 yum更换国内源 恢复系统默认yum源配置: [root@gaohanwei Packages]# cd /etc/yum.repos.d [root@gaohanwei yum.repos. ...

  7. Linux 如何安装程序的源代码软件包/源码程序包/源码包?

    文章目录 一.安装源码包的三个步骤 (一)执行命令 configure,进行配置/检测 (二)执行命令 make,编译源码 (三)执行命令 make install,安装软件 二.源码包安装示例 (一 ...

  8. Linux软件管理包-源码包与rmp包区别,及其安装与卸载

    一. rpm包与源码包的区别 安装前:概念上的区别,源码包是开源的,比RPM包安装更自由,但是它安装更慢,更容易报错:RPM包是经过编译的,不能看到源代码,但是它安装更快,报错更容易解决,只有依赖性问 ...

  9. maven deploy jar包到远程仓库400

    第一步,登陆nexus http://maven.repo.[公司域].com/nexus/#welcome 查看账号是否有上传权限,选择某个respository如果如下图所示,代表有权限 第二步, ...

  10. mysql源码安装报错_mysql 的二进制和源码包 安装的报错总结

    MySQL报错总结 报错原因:/application/mysql-5.6.44/tmp不存在 解决方法:mkdir /application/mysql-5.6.44/tmp 报错原因: /appl ...

最新文章

  1. HTML如何让图片覆盖背景颜色,css – 使用rgba背景颜色覆盖背景图像
  2. 剑指offer 算法 (分解让复杂问题简单)
  3. 【VMCloud云平台】私有云门户第一朵Web云(三)
  4. php写web服务器端,如何用php实现一个web服务器
  5. 时间序列:简易prophet
  6. ABAP Update Navigation Index
  7. 响应式网页设计简单入门
  8. [zz] 使用ssh公钥密钥自动登陆linux服务器
  9. IDEA版本控制工具VCS中使用Git,以及快捷键总结(不使用命令)
  10. 使用WinMTR软件简单分析跟踪检测网络路由情况
  11. 激光雷达电力巡基于机载激光雷达技术的输电线路树障普查及预警
  12. 笔记本电脑打开计算机里面会跳,笔记本电脑为什么闪屏_笔记本电脑闪屏的原因及处理方法...
  13. 微软产品内部协议大公开
  14. php webp格式转换,webp的格式的转换
  15. 张驰课堂:六西格玛中的Minitab软件,到底有多重要
  16. Windows8.1环境如何删除FlashHelperService.exe文件
  17. Matlab图像的灰度直方图
  18. Linux搜索文件和文件夹的方法
  19. 计算机应用基础第三版练习题答案,计算机应用基础练习题答案
  20. 为树莓派打实时preempt_rt补丁

热门文章

  1. 冰墩墩向你投来了一份花里胡哨的CSS知识手册,快来签收
  2. 〖全域运营实战白宝书 - 高转化文案速成篇④〗- 如何撰写摘要型文案?
  3. linux ps1详解,Linux-玩转系统提示符PS1
  4. linux外接无线网卡,外接无线网卡+linux配置指南
  5. 【总结】1298- 如何用油猴提升前端开发效率
  6. 笔记本电脑发射无线信号的操作步骤及命令
  7. 【《Real-Time Rendering 3rd》 提炼总结】(五) 第六章 · 纹理贴图及相关技术 The Texturing
  8. 路由器 telnet配置
  9. 网页版网络聊天室设计与实现(Java+SSH+MySQL)
  10. javascript书籍推荐