Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to create index even when only (one) sitemap.xml exists #3

Merged
merged 1 commit into from Dec 3, 2014

Conversation

mkurz
Copy link
Collaborator

@mkurz mkurz commented Dec 2, 2014

This is a fix for https://code.google.com/p/sitemapgen4j/issues/detail?id=8
When the number of total urls is smaller than maxUrls (50 000) and then using writeSitemapsWithIndex "only" the sitemap.xml will be generated and the count of sitemaps (e.g. sitemap1.xml, sitemap2.xml) is 0.
As a result when trying to write the Sitemap index file with writeSitemapsWithIndex we get an exception:

 java.lang.RuntimeException: No URLs added, sitemap index would be empty; you must add some URLs with addUrls

This pull request is basically the patch from comment 8.

@dfabulich Could you please merge and also release a new version? Thanks!

dfabulich added a commit that referenced this pull request Dec 3, 2014
Allow to create index even when only (one) sitemap.xml exists
@dfabulich dfabulich merged commit 29fea42 into dfabulich:master Dec 3, 2014
@mkurz
Copy link
Collaborator Author

mkurz commented Dec 3, 2014

@dfabulich Could you please release a new version to the maven repos (probably 1.0.2)? We urgently need this fix... If you need any help let me know. Thanks!

@dfabulich
Copy link
Owner

I won’t have time to do that this week. (We used an older pre-Sonatype mechanism to get into the Maven repository.) Can you set up a private remote repository for your organization?

On Dec 3, 2014, at 5:54 , M.K. notifications@github.com wrote:

@dfabulich https://github.com/dfabulich Could you please release a new version to the maven repos (probably 1.0.2)? We urgently need this fix... If you need any help let me know. Thanks!


Reply to this email directly or view it on GitHub #3 (comment).

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 3, 2014

@dfabulich It is not that urgent, we can wait a week. We actually use another library which depends on yours so it would be good if the fix would be in your official repos.
The project owner of the other library wants to release a new version soon, so I will tell him to postpone until you released the new version with this fix here (hopefully next week? 😉)
Thanks a lot!

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 9, 2014

@dfabulich Any chance for a new release this week?

@dfabulich
Copy link
Owner

@mkurz I am just not finding time for this. How about this? If I grant you commit rights, would you be able to take care of setting up an OSSRH account http://central.sonatype.org/pages/ossrh-guide.html for sitemapgen4j and getting it submitted?

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 12, 2014

@dfabulich Sure we can do that! So I will publish a new version 1.0.2 with the groupId com.github.dfabulich and the artifactId sitemapgen4j (like already set in pom.xml) - ok?

@dfabulich
Copy link
Owner

@mkurz Yup! OK, I added you as a collaborator. Let me know if you have questions.

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 12, 2014

@dfabulich Thanks! Will work on it as soon I find time!

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 12, 2014

First step is done: Created a ticket for the project: https://issues.sonatype.org/browse/OSSRH-12812

@dfabulich Can you do only one more thing? Can you register here and then tell my your username - so I (of course) give you also publishing rights etc. for sonatype?
Thanks!

@dfabulich
Copy link
Owner

@mkurz I'm dfabulich

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 13, 2014

@dfabulich I just released version 1.0.2. Because this is our first release under a new groupId, someone from the Sonatype team has to manually enable the sync mechanism to the Maven Central repos. I have no clue when this will happen, hopefully within the next hours. I then also released a 1.0.3-SNAPSHOT release, which already is availabe from the sonatype repos.
I also requested that you get all the staging/publishing rights. I will let you know when you have them ;)

After you have the rights and then want to release a new version or snapshot, you have to add your JIRA username/passwort to ~/.m2/settings.xml locally (because these credentials are also used for Sonatype itself), like this:

<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>your jira-username</username>
      <password><![CDATA[your jira-password]]></password>
    </server>
  </servers>
</settings>

Also make sure you have a pgp public/private key set up.

You can then mvn clean deploy to stage a new version. To now release this staged version you just have to run mvn nexus-staging:release or release it via the UI found at https://oss.sonatype.org (log in again). mvn nexus-staging:drop on the other hand drops the staged version and you can start over again.

If the version in the pom.xml file ends with -SNAPSHOT you just have to run mvn clean deploy as well to release the snapshot, but snaphots can not be synced to Maven Central.

That's the basics, maybe have a quick read though here, here, here, here - it's not very difficult.

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 13, 2014

And one more thing: If you want to release a version immediately to Maven Central when running mvn clean deploy (without running mvn nexus-staging:release afterwards or any UI hassle) just change autoReleaseAfterClose to true in the pom.xml:

<autoReleaseAfterClose>true</autoReleaseAfterClose>

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 14, 2014

@dfabulich The library is online! Check:
http://mvnrepository.com/artifact/com.github.dfabulich/sitemapgen4j

Can you also check if you can log in at https://oss.sonatype.org/ with your JIRA username/password?

@mkurz
Copy link
Collaborator Author

mkurz commented Dec 15, 2014

@mkurz mkurz deleted the sitemapIndexFix branch July 5, 2018 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants