preface

As the saying goes, everything has its first time. The more painful the experience, the more impressive it is. However, I am still afraid that I will forget some steps in the future, so I will record it for myself and everyone’s reference.

First of all, I complain that the various articles on the net I have turned over basic, baidu/Google out big process basic are all the same, just like the same mold carved out of, but the overall process is no problem, step by step according to line, most notably in our operations in the process of all kinds of wonderful work problems, It is difficult to find effective solutions to the problems that only occur in the actual operation of this thing, and the problems that occur vary from operation to operation. In addition, the small partners around us have little understanding of this, and even if there are one or two people who have done this, few people have detailed records in this aspect. So even if the memory of them with fuzzy told you some experience, but also provide nothing substantial help, or is it just on your own feeling slowly, and I myself after almost a week scratched under the head of baidu/Google finally, god helps those who help themselves, the final success will be uploaded to the Maven ZhongYangKu project, Can be normal use can also be normal follow-up maintenance, thinking about the process is bitter but the result is gratifying.

Well, here said the actual operation, this paper may be more nonsense, if students patience to read a text is not strong, think the za is bothersome, it’s no use to you, think the redundant, that either you please click on the close button again to find other articles of reference, otherwise please sit watching it slowly, of course you can selectively view, If you still think this article doesn’t help you at all, I’m sorry. I’m wrong. Bye

1. Code hosting

I won’t go into details about how important this step is. Hosting your project on Github/Gitee is great if you have already done this step, but if you haven’t done this step and don’t even know the code hosting platform, please do it on Baidu /Google. If you don’t even use one of the world’s most popular gay dating sites, you’re a bit Out of date.

Once you’re done hosting your code, record your project address (github.com/tangxbai/my…) I’ll use it later.

2. You need a Sonatype account

Of course, The Central Repository of Maven is not something you can just publish. Someone has to maintain it, someone has to approve it, and someone has to give you permission to publish your application. Issues.sonatype.org is the problem management system, which is similar to the JIRA system we usually use. The process is the same, but the staff is American students.

Tip: Review process is completed by the United States on the other side of the students, due to time zone differences, China and the United States time difference about 12 hours, if you commit operation during the day, the United States is there should be a night off work early, so you submit audit time seize opportunity, or submit slowly waiting, after fitting within an hour or two would be complete audit, No more than one working day. Remember to use English as you are not sure if others can read Chinese.

1, register an account (if you already have an account, I believe you are already familiar with the road, skip it)

Go to the official website to register an account, how to register such a problem I do not need to say it, after successful registration login can click the profile picture/user information/parameter configuration to set the preferred language, I set here is simplified Chinese, I will not stickers, please choose your own, students who are good at English can ignore this step.

2. Create an issue

Select Community Support – Maven Central (MVNCENTRAL) from the new /Create button on the toolbar and click open the popup form. Click ** New /Create ** to Create an issue. The following are some examples for your reference.

SCM URL/Project URL

Fill in your Github/Gitee address for these two.

4. Group Id description

One thing worth noting here is the Group Id. If you enter a personal domain name, you need to verify whether the current domain name belongs to you. If not, you can enter the corresponding personal address of Github.

5. Personal domain name verification (github personal address does not require this step)

Personal domain verification is also pretty simple, need in your domain name manager console to add a DNS domain name analytical record, type of TXT, value Issue address for you, similar to issues.sonatype.org/browse/OSSR… After the addition takes effect, add a comment under your issue and tell him “this is your own domain name”, and then wait for the reply from the staff. If it does not pass, he will tell you the specific reason. After passing, the project can be released normally as shown in the picture below.

Tip: how to verify their TXT records have been effective? If you see the following figure, the record is valid

6, waiting for review

After passing the review, the platform will tell you the result. If you fail to pass the review, you can modify it and fill in the remarks and submit it again for review. After passing the review, it will be as follows, which means relevant information has been prepared for us and the project can be released normally.

The last step

When your first project is published, come back and add a comment to tell the platform that you have built and close the issue. These processes are no longer required for any future projects to be published under the same Group Id.

At this point, Sonatype preparations are complete.

3. Improve POM.xml

Here is the reference list, with some important information in bold:

  • Name – Project name

  • GroupId – The Group Id you apply for in the issue must be the same, otherwise the issue verification fails

  • ArtifactId – Unique project Id of the same Group

  • Version – Project version, which corresponds to the version of the central library, depending on which version to upgrade or release

  • Url – Project address, either your own domain name or your github/ Gitee repository address

  • Description – The description of the project, which will be displayed when published to the central library

  • Licenses – An open source project agreement that adds the corresponding license description of your choice

  • SCM – Project repository address, usually the Github/Gitee repository address

  • Developers – List of developers

  • A list of ficolin-contributors, if one exists

  • DistributionManagement – Fill in the address provided to you before sonatype staff approves it

  • Build – Build packaging

  • InceptionYear – Optional, year of establishment

  • Organization – This is optional

  • Profiles – Optional, environment selection, can be added if perfect

  • Dependencies – Optional, depending on modules

  • Issue Management – Optional, issue management system, generally write githu/gitee issue address will do

Complete sample

<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>
    
        <! -- Basic information -->
	<groupId>com.viiyue.plugins</groupId>
	<artifactId>mybatis-mapper</artifactId>
	<version>1.1.1</version>
	<packaging>jar</packaging>
	
        <! -- Description -->
	<name>mybatis-mapper</name>
	<url>https://github.com/tangxbai/mybatis-mapper</url>
	<description>
		Mybatis generic mapper plugin for solving most basic operations, 
		simplifying sql syntax and improving dynamic execution efficiency
	</description>

        <! -- Year of project establishment, not required -->
	<inceptionYear>2017</inceptionYear>
	
        <! -- License, preferably added to avoid unnecessary trouble later -->
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>

        <! -- Warehouse address, SCM:xxx:Git :git -->
	<scm>
		<url>https://github.com/tangxbai/mybatis-mapper.git</url>
		<connection>scm:git:[email protected]:tangxbai/mybatis-mapper.git</connection>
		<developerConnection>scm:git:[email protected]:tangxbai/mybatis-mapper.git</developerConnection>
		<tag>HEAD</tag>
	</scm>

        <! -- Problem management system, optional, best -->
	<issueManagement>
		<system>GitHub Issue Management</system>
		<url>https://github.com/tangxbai/mybatis-mapper/issues</url>
	</issueManagement>

        <! -- Issue management, a node that must be configured to publish to the central library, the following two links can be found from the issue audit results -->
        <! - the id of the custom, behind in maven/config/Settings. The corresponding server configuration information in XML - >
	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
		</repository>
	</distributionManagement>

        <! -- Developer list, for individual, write yourself, for team, list all members -->
	<developers>
		<developer>
			<name>tangxbai</name>
			<email>[email protected]</email>
			<timezone>GMT+8</timezone>
			<url>https://github.com/tangxbai</url>
		</developer>
	</developers>

	<properties>
		<java.version>1.8</java.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		
        <! -- License License source file header configuration for plug-in, not required -->
        <license.licenseName>apache_v2</license.licenseName>
		<license.verbose>false</license.verbose>
		<license.failOnMissing>true</license.failOnMissing>
		<license.failOnUnknown>true</license.failOnUnknown>
		<license.failIfWarning>true</license.failIfWarning>
		<license.failOnForbidden>true</license.failOnForbidden>
		<license.organizationName>${project.name}</license.organizationName>
		<license.sectionDelimiter>#</license.sectionDelimiter>
		<license.processStartTag>Start tag</license.processStartTag>
		<license.processEndTag>End tag</license.processEndTag>
        <license.xxx>.</license.xxx>
	</properties>

        <! -- Module dependency, not required -->
	<dependencies>.</dependencies>

        <! -- Package plugin -->
	<build>
		<plugins>
			<! -- Maven compiles plugins, optional, and generates xxx.jar -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.0</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>

			<! -- Java source code plug-in, optional, packaged to generate xxx-sources.jar -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<! -- Javadoc, document plugin, optional, packaged to generate xxx-javadoc.jar -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.1.1</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
                            <! -- after Jdk1.8, document generation verification is very strict, so you can turn off document verification -->
							<doclint>none</doclint>
							<applyJavadocSecurityFix>false</applyJavadocSecurityFix>
							<failOnError>false</failOnError>
							<failOnWarnings>false</failOnWarnings>
							<additionalparam>-Xdoclint:none</additionalparam>
							<additionalJOption>-Xdoclint:none</additionalJOption>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<! -- GPG signature verification, must, this is very important, upload to the central library used to verify the signature is very important credentials -->
            <! -- GPG signature will be discussed in detail later, here is a GPG plugin -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.6</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<! -- License, optional, used to generate a License text comment in the source file header -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>2.0.0</version>
				<executions>
					<execution>
						<id>generate-license-headers</id>
						<goals>
							<goal>update-file-header</goal>
						</goals>
						<phase>process-sources</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>

Copy the code

At this point, the configuration for the project is complete.

4. Maven configuration

Well, with the project and everything configured, there are a lot of problems…

1. How to publish?

Maven bring the deploy plug-ins, we do not need in any configuration file configuration, but if you want to reload the configuration, can be in pom. Change the default configuration in XML, there should not be too much, it is good to the default configuration, other need not care too much, as long as can help us to upload code executing the following command, but don’t busy executive orders, And then we look down.

$ mvn clean deply
Copy the code

2. Where to publish?

Of course, it is published to the central library, so how will maven know? Here is the configuration information, or you can look at it in combination with pom.xml above. Note that the ID value, as mentioned in the previous section, is arbitrary but must be the same as the server node ID in settings.xml.

These two links are dead, so you can copy them directly, or you can use this value if you don’t want to change the ID.

<distributionManagement>
    <snapshotRepository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
        <id>ossrh</id>
        <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
</distributionManagement>
Copy the code

3. Under whose name?

It is the issues.sonatype.org account that you registered before. This needs to be known to Maven, so next you need to make changes to maven’s configuration file. The path is as follows: / path/maven/conf/Settings. The XML, under the root node to add a node id the servers randomly, remember that consistent with the above, then your account/password information.

<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">.<servers>
        <server>
            <id>ossrh</id>
            <username>tangxbai</username>
            <password>* * *</password>
        </server>
    </servers>.</settings>
Copy the code

At this point, Maven configurations are complete.

5. GPG signature

Use instructions

Maven uses asymmetric key pairs to check signatures when a project is published to verify whether the uploader is you, otherwise anyone can upload or even change your repository for you. If it is not you, it can only be uploaded and not normally published to the central library.

episode

Then someone will say, many articles on the Internet steps are not like this ah, about GPG are put in the first few steps, why do you put it in the back? Well, because there are too many holes, I vomits blood when I step on it. This is also the most problematic step in the whole process, so at the end, of course, you can also prepare your GPG information in case of need, anyway, it will be used sooner or later. If you don’t have any problems following the steps on the Internet, just pay attention to how to use the same information for GPG signatures on other computers. Have you thought about it? If not, think about it now…

A special emphasis on

GPG signatures as ZhongYangKu check application an important things, various articles online turned over at the beginning, no one said it’s useful, are blind to teach and how to use a lot of useless command, confusing, or even don’t say it in the whole process of the practical use, must it not? What’s the difference with or without it? Do you know what it’s like to spend a whole day trying and failing to find a solution?? Frankly speaking, I broke my skull, could not find anyone to ask, no one around me knew, and all kinds of technical groups were unable to speak. Finally, I even tried to get rid of this disgusting step, and directly packaged and uploaded to the central library.

However goose, I am really too naive, actual experience tells me, this TM is essential!! I what a fuck, online articles are simply unreliable to the sky, dizzy death! No one went into detail about the problems that might arise… Alas, the first time really hurt…

Remember: GPG is a very important thing in the process of releasing the project to the central library, so do not try to omit this step like I did, it will only waste time, no matter what problems you encounter, calm and calm again, always need to overcome this difficulty.

Install the Gpg4win

Gpg4win.org/thanks-for-… This is a download address, interested students can download down to study, here about this tool I won’t be too much, all other articles online is carried out on the basis of this, you are jumping but this tool, but the actual prove it with little eggs, and slow network still have to wait for it to download and install, personal feel a waste of time, If you want to use this thing, please search /Google…

Git/GPG

The GPG command is included in your git program, which is one of the reasons why you can skip Gpg4win. If you have any doubts, please open your git UI and type GPG –version to see if GPG is generated: Command not found, if there is no error, it should be… If this fails, check whether your git version is too low, or whether it has been too long since you upgraded it.

If you need to check the directory, please check it by yourself. If you need to check the directory on Mac, please skip it. I don’t know.

reminders

If you have gg4win installed, it will automatically add an environment variable to your computer. You can run the GPG command directly from any command window. If you are like me, you must run it from Git UI command line.

Also, if you have Gpg4win installed, do not run it on the Git UI command line, because you will use the GPG program that comes with Git, not the program you installed.

Basic commands

Basic commands descr
gpg –gen-key Generate the key
gpg –gen-revoke [ID] Generate key revocation certificate
GPG –armor –output [file path] –export [ID] Export the specified public key to the specified file
GPG –armor –output [file path] –export-secret-keys [ID] Export the specified private key to the specified file
GPG –keyserver –send-keys [ID] Upload it to the key server
GPG –keyserver –recv-keys [ID] Check whether the upload is successful (wait a minute or two)
GPG –import [key file] Import your existing key into the current computer
GPG –keyserver [server] –search-keys [ID] Pulls the key with the specified ID from the server to the current computer
. Other more commands by yourself baidu /Google

Generate the key

$ gpg --gen-keyGPG (GnuPG) 2.2.17; Copyright (C) 2019 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? RSA keys may be between 1024 and 4096 bits long. What keysize do you want? The longer the length, the more secure the key. 2048 Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n>  = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 0 # Key expiration time, 0 will never expire, if it Is not frequently changed, set it to 0. Key does not expire at all Is this correct? (y/N) y # input y Key is valid for? (0) 0 # input 0 Key does not expire at all Is this correct? (y/N) y # enter y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <[email protected]>" Real name: tangxbai Email address: [email protected] Comment: com.viiyue.secrets # 描 述 信息选填 You selected this user-id: "tangxbai (com.viiyue.secrets) <[email protected]>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O # enter O You need a Passphrase to protect your secret key. ***** # Enter your key password, don't fill it out, this is very important, We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. .... +++++ +++++ We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. .... + + + + +.. +++++ gpg: /c/Users/Administrator/.gnupg/trustdb.gpg: trustdb created gpg: key [ID] marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0 j, j, j, j, j, j, j, j, j, j Key fingerprint = ********* uid Tangxbai (com.viiyue.secrets) <[email protected]> sub 2048R/[ID] 2019-10-14 # This ID has not been studied carefully. Interested students can study itCopy the code

At this point, the occurrence of the above information means that the key has been generated. I have tried this step for N times, and basically there will be no problems. If you have any problems, you can write to me in private.

reminders

There’s one important thing to point out here, and it took me a couple of steps to compare it, and maybe you already know it, but I’m being silly, but I can’t find any documentation on the Internet, and one file called secring.gpg is particularly important, so after a lot of checking, It is your private key, a very important file for providing the file signature, and it is only generated when the key is first generated, so take care of it.

Notes on secring.gpg

Why am I saying that this private key file is particularly important? Because you can publish your project on other computers with it, I believe you do not want to operate on a certain machine, be flexible, what time is it, we certainly need Coding everywhere, if we lack this file, The following error occurs when you execute MVN Clean Install or MVN clean deploy:

$ mvn clean install/deploy.#Vaguely remember seems to be such a mistake, too lazy to try again to screenshot, will see...
gpg: no default secret key: No secret key
gpg: sign failed: No secret key
...
Copy the code

So once again, keep it safe.

Export key

#Export the public key
$ gpg --armor --output public-key.txt --export [ID]
#Export the private key
$ gpg --armor --output private-key.txt --export-secret-keys [ID]
Copy the code

–armor This command can be used without it, plus it is saved in plain ASCII code, otherwise it is an encrypted string of unreadable things.

Uploading to the server

#Upload to the server, ID is the ID from which you generated the key
$ gpg --keyserver [key-server] --send-keys [ID]
#Check whether the upload is successful (it takes several minutes to take effect)
$ gpg --keyserver [key-server] --recv-keys [ID]
Copy the code

It is important to note that the maven ZhongYangKu to verify signature file, server provides multiple signature for us to use, it will attempt to pull from each server’s public key and then you say file compare, but after we upload the key information, need to wait for a long time, it will be your information to other key server, this is a long process, Anyway, I haven’t done waiting for several hours, probably synchronization procedure will only be activated in a specific time, so we don’t blind, etc, can be manually push the information to the server, thus shorten the waiting time, it is important to note that many servers seem to be foreign websites, can access, but speed is slow, still need to wait for a few minutes.

List of Public Key Servers

Here I have compiled a list of the servers that may be involved, and you can manually upload to these servers by using the upload command above.

  • hkp://pool.sks-keyservers.net
  • hkp://keyserver.ubuntu.com
  • hkp://subkeys.pgp.net
  • hkp://pgp.mit.edu
  • hkp://www.gpg-keyserver.de

You know what? I’ll just post one… Separate execution, do not execute all together, to be successful after the execution of the next, successful information is not posted, a little cognitive words probably know what output information on behalf of success?

$ gpg --keyserver hkp://pool.sks-keyservers.net --send-keys [ID]
$ gpg --keyserver hkp://keyserver.ubuntu.com --send-keys [ID]
$ gpg --keyserver hkp://subkeys.pgp.net --send-keys [ID]
$ gpg --keyserver hkp://pgp.mit.edu --send-keys [ID]
$ gpg --keyserver hkp://www.gpg-keyserver.de --send-keys [ID]
Copy the code

reminders

Uploading the key file to the server is also a must, including making sure it can be detected! After uploading to the temporary storage area of Maven central library, the platform will pull the corresponding ID of the public key file from the key server to verify whether the signature of your project file is correct. Otherwise, the central library will report an error of No public secret key, so try to ensure that your key can be uploaded successfully. If the network is wrong, it is recommended to try several times.

When we click project Close in the temporary storage area of the central database after successfully uploading, the platform will report a mistake of Missing signature, that is, your project lacks signature information. After searching the Internet for a long time and finally thinking back, maybe this plugin is a must… Finally, it was verified.

Other computers use GPG

This problem is also searched for a long time, but finally solved, is worth encouraging. There are two ways, one is to import the key file you exported above to the computer by command, the other is to pull from the server.

#Import the key file directly
$GPG --import [key file]
#Pull from the server, please refer to the list of servers listed above
$ gpg --keyserver [key-server] --search-keys [ID]
Copy the code

gpg-agent

This command is not used here, mainly when performing a maven project packaging or upload GPG signatures may appear problem, specific error don’t remember clearly, anyway, roughly means need to run this command, lower version of git may not have this tool, need to upgrade to the latest version of git program, simply run the line.

#Check whether the command exists
$ gpg-agent --version
#Run this command
$ gpg-agent
Copy the code

At this point, the use of GPG and precautions are about the same.

6. Upload projects

There is nothing too much to say about this step, the only thing you need to make sure is that there are no problems with your project’s normal package installation…

Execute the command

$ mvn clean deploy. Uploaded: https://oss.sonatype.org/content/repositories/snapshots/com/viiyue/plugins/mybatis-mapper/1.1.0/mybatis-mapper-1.1.0-sou Rces.jar. asC (499 B at 1.2 KB/ SEC) Uploading: https://oss.sonatype.org/content/repositories/snapshots/com/viiyue/plugins/mybatis-mapper/maven-metadata.xml Uploaded: https://oss.sonatype.org/content/repositories/snapshots/com/viiyue/plugins/mybatis-mapper/maven-metadata.xml (2 KB at 1.5 KB/SEC) Uploading: https://oss.sonatype.org/content/repositories/com/viiyue/plugins/mybatis-mapper/1.1.0/mybatis-mapper-1.1.0-javadoc.jar.a sc Uploaded: https://oss.sonatype.org/content/repositories/snapshots/com/viiyue/plugins/mybatis-mapper/1.1.0/mybatis-mapper-1.1.0-jav Adoc.jar. asC (499 B at 1.2 KB/ SEC) Uploading: https://oss.sonatype.org/content/repositories/com/viiyue/plugins/mybatis-mapper/maven-metadata.xml Uploaded: https://oss.sonatype.org/content/repositories/snapshots/com/viiyue/plugins/mybatis-mapper/maven-metadata.xml (2 KB at 1.1 KB/SEC) [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 52.221s [INFO] Finished at: 2018-07-14T22:14:28+08:00 [INFO] Final Memory: 25M/297M [INFO] ------------------------------------------------------------------------Copy the code

Results analysis

When you execute the command and get the above results, then congratulations to you, you have succeeded 80%, you are about to stand on the peak of life, towards the road to meet the bai Fu Mei/gao Fu Shuai, kidding, far off…

7. Return to maven management platform

If you still don’t know the address of the management platform, then I take the trouble to paste it again for you…

  • Issues.sonatype.org – Issue Management System, the system where you register your account
  • Oss.sonatype.org/ – Central warehouse management platform

Log in to the management platform, the account/password is the original account you registered.

Publish the project

Once you get to the main page, go to the Staging Repositories area. If your project doesn’t have a release plugin set up, go there and find the project you’re working on. Select it and you’ll see the Close button at the top. Shut down the warehouse. No more uploads allowed. If this is done successfully, when you hit Refresh you should see the Release button light up and press it to publish. If the shutdown fails, you can look at the interface below, find the cause of the failure, upload the code again, close and publish.

If you read the crap I’ve written above, it should go well and launch your project.

The following problems may occur

#Symptom 1: GPG file signature is missing. Configure your GPG file properly.
Missing signature 
#Symptom 2: Your public key is not found on any public key server
No public key: Key with id: (XXXXX) was not able to be located (oss.sonatype.org) 
Copy the code

For the second point, you can refer to the following website:

Stackoverflow.com/questions/1…

As I mentioned above, either you have not uploaded your public key to the server, or the server has not fully synchronized your public key information. To shorten the synchronization process, you can manually upload your public key information to multiple servers. For this, please go back to the GPG signature above.

So far, all the problems I have encountered in the whole process are listed in the form of nonsense, I hope you do not encounter these problems, if you encounter these problems do not be nervous, I hope this article can help you.

When will it take effect?

When you have clicked Release, remember to go back to your issues.sonatype.org to reply that you have published your first project, starting with approval, It’s available in Central (search.maven.org/) every few minutes to an hour, but it’s only a subset of the sites, The Maven server (maven.aliyun.com) and the Maven repository (mvnrepository.com/) will take effect after one or two days. It shouldn’t take more than a day.

8, the last

If you’re here, congratulations, you’ve got your first public project that can be used anywhere. It’s hard to start with, but you’ll be fine later. Any project that’s published under the same Group Id doesn’t need to be so hard, just execute deploy. Then wait a day or two and the central banks will be synchronized.

Although there is a lot of nonsense and words, I am glad if there is any help for you. If you think there is any help for you, please click a “like” or share it with your friends in need.