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

maven: consuming artifacts #71

Closed
maggu2810 opened this issue Apr 14, 2015 · 19 comments
Closed

maven: consuming artifacts #71

maggu2810 opened this issue Apr 14, 2015 · 19 comments
Assignees
Labels
Milestone

Comments

@maggu2810
Copy link
Contributor

@maggu2810 maggu2810 commented Apr 14, 2015

Is the consuming of artifacts using maven (or to look around a browser on the url /maven/) only possible if the artifacts were uploaded using maven deploy?
I created a channel and upload bundles using the drop feature of the web page. This channel shows no content using the specific maven url. Exist this problem because of the missing xyz.pom file? This pom files are included in the jar (normally). Could we extract them?

@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 14, 2015

Yes, this is true. Right now the Maven repository only works if the files got uploaded by maven and the maven repository aspect is present.

True, the pom file could be extracted from the JAR and the "groupId", "artifactId" and "version" could be extracted from the pom file as well.

@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 14, 2015

So the only thing that would be needed from quick look at it, might be a virtualizer which extracts the POM file from the JAR. And a meta data extractor which extracts the GAV information from the POM. The rest should be automatic based on what is already there.

ctron added a commit that referenced this issue Apr 16, 2015
ctron added a commit that referenced this issue Apr 16, 2015
@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 16, 2015

So extracing the pom and the metadata for the pom was easy.

The hard part is getting the maven meta data one layer upwards to the jar file.

@ctron ctron self-assigned this Apr 16, 2015
@ctron ctron added the enhancement label Apr 16, 2015
@maggu2810

This comment has been minimized.

Copy link
Contributor Author

@maggu2810 maggu2810 commented Apr 17, 2015

If that is hard for you, it would be much harder for someone that does not know the architecture. ;-)
Thank you, I think this would be a great feature!

@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 17, 2015

True 😉 But I will keep working on this. And if you are in Munich, I can explain it to you while having some 🍺

ctron added a commit that referenced this issue Apr 20, 2015
This commit adds an artifact to the maven repository structure if
there is a child-artifact element which is an extracted POM file.

It takes GAV from the POM file and the extension is the extension of
the artifact name.

This is the last commit which enables uploading JAR files, which
contain a "pom" and re-created the maven repository structure, allowing
maven read access to this artifact.
@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 20, 2015

Ok, so the last commit does locate the child pom artifact and take GAV from it, using the extension from the local artifact name.

In the end this creates a Maven Repository entry for the artifact based on the extracted POM file.

So for this to work, two aspects have to be present on the channel: Maven Extractor, Maven Repository

ctron added a commit that referenced this issue Apr 20, 2015
@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 20, 2015

And I just incremented the Maven Repository aspect version to indicate a change in the meta data format.

@maggu2810

This comment has been minimized.

Copy link
Contributor Author

@maggu2810 maggu2810 commented Apr 21, 2015

Great!

@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 21, 2015

Do you have way to test it without a milestone build?

@ctron ctron added this to the v0.7.0-M1 milestone Apr 21, 2015
@maggu2810

This comment has been minimized.

Copy link
Contributor Author

@maggu2810 maggu2810 commented Apr 22, 2015

I will use the Eclipse IDE with the master branch.

@maggu2810

This comment has been minimized.

Copy link
Contributor Author

@maggu2810 maggu2810 commented Apr 22, 2015

I use the drag and drop feature of the newly created channel (with all aspects added) and dropped two jar files (karaf console bundles, but that should not be related).

I configured maven to use the local test package-drone channel as mirror of *.

I started the following commands to download the two jar and the two pom files using maven.

mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=org.apache.karaf.shell:org.apache.karaf.shell.core:4.0.0.M2:jar -DoutputDirectory=.
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=org.apache.karaf.shell:org.apache.karaf.shell.core:4.0.0.M2:pom -DoutputDirectory=.
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=org.apache.karaf.shell:org.apache.karaf.shell.console:4.0.0.M2:jar -DoutputDirectory=.
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy -Dartifact=org.apache.karaf.shell:org.apache.karaf.shell.console:4.0.0.M2:pom -DoutputDirectory=.

cut down output:

Downloading: http://127.0.0.1:8082/maven/13B1E385-5484-4FF0-A4ED-B12376117653/org/apache/karaf/shell/org.apache.karaf.shell.console/4.0.0.M2/org.apache.karaf.shell.console-4.0.0.M2.jar
Downloaded: http://127.0.0.1:8082/maven/13B1E385-5484-4FF0-A4ED-B12376117653/org/apache/karaf/shell/org.apache.karaf.shell.console/4.0.0.M2/org.apache.karaf.shell.console-4.0.0.M2.jar (351 KB at 760.9 KB/sec)
Downloading: http://127.0.0.1:8082/maven/13B1E385-5484-4FF0-A4ED-B12376117653/org/apache/karaf/shell/org.apache.karaf.shell.console/4.0.0.M2/org.apache.karaf.shell.console-4.0.0.M2.pom
Downloaded: http://127.0.0.1:8082/maven/13B1E385-5484-4FF0-A4ED-B12376117653/org/apache/karaf/shell/org.apache.karaf.shell.console/4.0.0.M2/org.apache.karaf.shell.console-4.0.0.M2.pom (9 KB at 31.4 KB/sec)
Downloading: http://127.0.0.1:8082/maven/13B1E385-5484-4FF0-A4ED-B12376117653/org/apache/karaf/shell/org.apache.karaf.shell.core/4.0.0.M2/org.apache.karaf.shell.core-4.0.0.M2.jar
Downloaded: http://127.0.0.1:8082/maven/13B1E385-5484-4FF0-A4ED-B12376117653/org/apache/karaf/shell/org.apache.karaf.shell.core/4.0.0.M2/org.apache.karaf.shell.core-4.0.0.M2.jar (371 KB at 1142.4 KB/sec)
Downloading: http://127.0.0.1:8082/maven/13B1E385-5484-4FF0-A4ED-B12376117653/org/apache/karaf/shell/org.apache.karaf.shell.core/4.0.0.M2/org.apache.karaf.shell.core-4.0.0.M2.pom
Downloaded: http://127.0.0.1:8082/maven/13B1E385-5484-4FF0-A4ED-B12376117653/org/apache/karaf/shell/org.apache.karaf.shell.core/4.0.0.M2/org.apache.karaf.shell.core-4.0.0.M2.pom (8 KB at 25.8 KB/sec)

Fine!

@maggu2810

This comment has been minimized.

Copy link
Contributor Author

@maggu2810 maggu2810 commented Apr 22, 2015

The unzipped pom files are all named pom.xml.
Should we rename that files to use the name of the jar file and just replace the ending .jar with .pom?
That would be the result if we use maven deploy.

@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 22, 2015

Cool :) Thanks for testing.

Well I did consider this as well. The name. However right now the parent artifact needs to find group, artifact, version from the child artifact. And the child artifact is currently found by simply looking for pom.xml. And in the directory index it also is called artifact-id.pom.

Of course the parent could also look for basename.pom ... I am not sure ...

@maggu2810

This comment has been minimized.

Copy link
Contributor Author

@maggu2810 maggu2810 commented Apr 22, 2015

It would be much nicer for the channel view "List" (url: .../viewPlain), as this shows a lot of "pom.xml" files.
Sure, the "Content" view will group this, but it would be nice, if the name (in the list view) would be equal to that one maven deploy is using.

@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 22, 2015

True! The list view will look horrible that way. I am rarely using it anymore ;-)

Ok ... I will change it!

ctron added a commit that referenced this issue Apr 22, 2015
@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 22, 2015

Done

@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 22, 2015

You will need to regenerate the metadata in order to see it. Both ways are possible now.

@maggu2810

This comment has been minimized.

Copy link
Contributor Author

@maggu2810 maggu2810 commented Apr 22, 2015

This is very great!

@maggu2810 maggu2810 closed this Apr 22, 2015
@ctron

This comment has been minimized.

Copy link
Owner

@ctron ctron commented Apr 22, 2015

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.