blackears / svgSalamander

158 stars 57 forks source link

maven repository #9

Open dpolivaev opened 7 years ago

dpolivaev commented 7 years ago

We (Freeplane team) would like to access your library in maven - repository. The procedure how to get it there is described at http://central.sonatype.org/pages/ossrh-guide.html If we can give you any support please let me know.

Kind regards, Dimitry

blackears commented 7 years ago

I've written an Ant task which compiles a jar which I believe conforms to the requirements for Maven, but when I upload it it is rejected. Would you have any idea what might be wrong with it? I'm using the manual staging and deployment method.

https://drive.google.com/open?id=0B65Z2rSspR06bW1xUUtqdXdmb2c

fnatter commented 7 years ago

hello Mark,

you chose

  <groupId>com.kitfox.svgSalamander</groupId>
  <artifactId>core</artifactId>

Usually, the groupId is the id of the "development organization" and the artifactId is the id of the "product". So I would suggest (this is what we used for debian):

    <groupId>com.kitfox</groupId>
    <artifactId>kitfox-svg-salamander</artifactId>

or (closer to what you chose):

    <groupId>com.kitfox</groupId>
    <artifactId>svgSalamander</artifactId>

(but this is not mandatory)

I guess (not knowing which ant/sonatype documentation you used) your bundle.jar must follow the maven repository layout:

<groupId-with-slashes>/<artifactId>/<version>/POM
<groupId-with-slashes>/<artifactId>/<version>/JARS

I.e. with your choice of groupId/artifactId: com/kitfox/svgSalamander/core/1.1.2/core-1.1.2-javadoc.jar com/kitfox/svgSalamander/core/1.1.2/core-1.1.2-javadoc.jar.asc com/kitfox/svgSalamander/core/1.1.2/core-1.1.2-sources.jar com/kitfox/svgSalamander/core/1.1.2/core-1.1.2-sources.jar.asc com/kitfox/svgSalamander/core/1.1.2/core-1.1.2.jar com/kitfox/svgSalamander/core/1.1.2/core-1.1.2.jar.asc com/kitfox/svgSalamander/core/1.1.2/core-1.1.2.pom com/kitfox/svgSalamander/core/1.1.2/core-1.1.2.pom.asc

As you can see, the jars are labeled with the artifactId.

Here is the layout with this structure and the suggested:

    <groupId>com.kitfox</groupId>
    <artifactId>svgSalamander</artifactId>

:

./com ./com/kitfox ./com/kitfox/svgSalamander ./com/kitfox/svgSalamander/1.1.2 ./com/kitfox/svgSalamander/1.1.2/svgSalamander-1.1.2-javadoc.jar.asc ./com/kitfox/svgSalamander/1.1.2/svgSalamander-1.1.2-javadoc.jar ./com/kitfox/svgSalamander/1.1.2/svgSalamander-1.1.2-sources.jar.asc ./com/kitfox/svgSalamander/1.1.2/svgSalamander-1.1.2-sources.jar ./com/kitfox/svgSalamander/1.1.2/svgSalamander-1.1.2.pom.asc ./com/kitfox/svgSalamander/1.1.2/svgSalamander-1.1.2.pom ./com/kitfox/svgSalamander/1.1.2/svgSalamander-1.1.2.jar ./com/kitfox/svgSalamander/1.1.2/svgSalamander-1.1.2.jar.asc ./META-INF ./META-INF/MANIFEST.MF

(note that I also changed the pom)

The source jar is also wrong: main/java/com/kitfox/svg/xml/StyleSheet.java --> the directory structure must reflect the package hierarchy: com/kitfox/svg/xml/StyleSheet.java Generated files have the same problem: gen/java/com/kitfox/svg/animation/parser/ASTEventTime.java --> com/kitfox/svg/animation/parser/ASTEventTime.java

(the source jar will be used i.e. by IDEs to locate classes based on package+name)

Also the resources are prefixed by "test": test/res/1C2EC147.png

BTW: Could you also make a 1.1.2 release on github? I guess you want to do this once the maven upload succeeds?

Thanks and Best Regards, Felix

blackears commented 7 years ago

I made the changes you suggested and uploaded again. It seemed to succeed this time. I was told it created a repository at:

https://oss.sonatype.org/content/repositories/central_bundles-9658/

I created this using the groupId: com.kitfox and the artifactId: svgSalamander.

blackears commented 7 years ago

I'm unable to push my changes to github at this time. Someone else has made changes and is requesting a merge (https://github.com/blackears/svgSalamander/pull/12#pullrequestreview-25126585). Since I disagree with some of the changes that have been made, I've requested them to make some changes. As far as I can tell, I cannot commit my own changes until that issue has been resolved.

fnatter commented 7 years ago

hi Mark,

you can commit while the pull request is in progress. Only if there are conflicts, you will need to resolve them, so this should be safe.It is just like any other user would want to push commits in parallel.

This path: https://oss.sonatype.org/content/repositories/central_bundles-9658/com/kitfox/svgSalamander/1/1/2/com/kitfox/svgSalamander/1.1.2/ looks strange, but I will try to fetch this from freeplane later.

Cheers and Best Regards, Felix

fnatter commented 7 years ago

hi Mark,

the maven repo (https://oss.sonatype.org/content/repositories/central_bundles-9658/) is not 100% correct. It should be a path in which "/com/kitfox/svgSalamander/1.1.2/" is a relative path. With your repo, I would need to specify maven { url "https://oss.sonatype.org/content/repositories/central_bundles-9658/com/kitfox/svgSalamander/1/1/2" } in the client software, which won't work because I have will only ever get 1.1.2 ("1/1/2" is in the maven url). Can you point me to the sonatype documentation that you followed?

Other than that, the binary and source jars work fine, thanks :-)

Cheers and Best Regards, Felix

blackears commented 7 years ago

Are you sure this is supposed to have such a strange path? I'm following http://central.sonatype.org/pages/manual-staging-bundle-creation-and-deployment.html and it seems to be putting the jars at the root.

In any case, I'm having trouble building the bundle. I'm putting the jars into a directory named 1.1.2, but when I zip that into a jar (using the ant jar task), the jar tool must be interpreting that as a package name and is turning it into separate directories. I'm not sure how to fix this problem.

If you want to take a look yourself, the ant script I wrote to package everything is the maven-publish task in the build.xml file of the svg-salamander-core tree.

nidi3 commented 5 years ago

I adjusted the pom.xml in svg-core so that it becomes deployable on maven central: https://github.com/nidi3/svgSalamander/blob/master/svg-core/pom.xml mvn deploy -Pdeploy does the trick. There's now guru.nidi.com.kitfox:svgSalamander:1.1.2 on maven central.

blackears commented 5 years ago

What changes did you make? Is this something that could be applied to the core project?

nidi3 commented 5 years ago

I would love the changes to be applied to the core project!

https://github.com/blackears/svgSalamander/compare/master...nidi3:master I added distributionManagement, nexus-staging-maven-plugin, maven-gpg-plugin, maven-source-plugin, maven-javadoc-plugin

For the gpg plugin to work, you need to generate and publish you own key pair: https://central.sonatype.org/pages/working-with-pgp-signatures.html

nidi3 commented 5 years ago

see https://github.com/blackears/svgSalamander/pull/40

th0masb commented 2 years ago

Any progress on this? I'm having to use the forked version because nothing has been published to maven central.

blackears commented 2 years ago

I tried and failed again to try and get this published on Maven a few weeks ago. I don't think this is going to happen unless I can have someone I can live chat with who can walk me through this. However, a third party is publishing this too so you can use their publication: https://github.com/blackears/svgSalamander/discussions/74#discussioncomment-3817832