-
Notifications
You must be signed in to change notification settings - Fork 89
[SHRINKWRAP-535] Add readme #168
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
Conversation
README.md
Outdated
| ## Requirements | ||
|
|
||
| - **JDK**: Version 8 or newer. | ||
| - **Maven**: Version 2.2.0 or newer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, why 2.2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the minimum version I found in the Maven enforcer plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried building it with Maven 2.2.0? I'm curious if it will even work
README.md
Outdated
| Each archive supports adding `Node` under `ArchivePath` , where `Node` can be directory or `Asset`. | ||
|
|
||
| - `Node`: An entry in an `Archive`; may represent content or a directory | ||
| - `ArchivePath`: Location in an `Archive` under which a `Node` lives |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the "lives" part. Are there better alternatives? Exists? Is stored? Is Located? Resides? What do you think @xjusko
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still valid @xjusko
| Domain defaultDomain = ShrinkWrap.createDomain(); | ||
|
|
||
| // Create a domain with a custom configuration builder | ||
| Domain domain = ShrinkWrap.createDomain(new ConfigurationBuilder().executorService(service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps an example about the executorService or extensionLoader could be provided as well. If it's short enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I can write any short example..., but there are more extensive examples in tests.
README.md
Outdated
| // Add content to the archive | ||
| customJavaArchive.addClass(MyClass.class); | ||
|
|
||
| // Export the archive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is not necessary, we have the one above
README.md
Outdated
| // Create an archive within a custom domain | ||
| JavaArchive customJavaArchive = customDomain.getArchiveFactory().create(JavaArchive.class, "customArchive.jar"); | ||
|
|
||
| // Add content to the archive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this comment to reflect more that the behavior remains the same for the custom domain as well. Something such as "Add content to the archive within a custom domain. It behaves as normal archive"
Just don't use this exact comment I provided, that was just a brainstorming :)
README.md
Outdated
| You can create and export JAR files for deployment to Java EE servers or for use in testing frameworks like Arquillian. | ||
|
|
||
| ```java | ||
| // Create a new Java archive (JAR) using ShrinkWrap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The missing line breaks are making this hard to read. In other code blocks there's always an empty line before the comment. I'd use the same approach here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the indentation is wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a new Java archive (JAR) using ShrinkWrap -> Create a new Java archive (JAR) using ShrinkWrap containing TestClass class and a StringAsset
README.md
Outdated
|
|
||
| ### Contributing | ||
|
|
||
| If you have suggestions for improvements or would like to contribute to ShrinkWrap, please visit our [issue tracker](https://issues.redhat.com/projects/SHRINKWRAP/issues) on the SHRINKWRAP project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on the SHRINKWRAP -> for the SHRINKWRAP
README.md
Outdated
| The `ShrinkWrap` class is the entry point to the ShrinkWrap library, enabling users to create and manage archives and domains. | ||
| It provides static methods to create archives and domains with either default or custom configurations. | ||
|
|
||
| ### Working With Shrinkwrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is the difference between "Working with Shrinkwrap" and "Using Shrinkwrap"? :)
README.md
Outdated
| ClassLoader tccl = Thread.currentThread().getContextClassLoader(); | ||
| URL webxml = tccl.getResource("basic.war/web.xml"); | ||
| URL resource = tccl.getResource("basic.war/index.html"); | ||
| if (resource == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary for the example
README.md
Outdated
| ear.add(jar, new BasicPath("/lib"), ZipExporter.class); | ||
|
|
||
| // Export the EAR to a file | ||
| new ZipExporterImpl(ear).exportTo(file, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where exactly does the file come from?
README.md
Outdated
| ```java | ||
| // Create a WebArchive (WAR) with the specified name and content | ||
| WebArchive war = ShrinkWrap.create(WebArchive.class, archiveName); | ||
| war.addAsWebResource(new StringAsset(content), "page.html"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where exactly does this content come from?
|
I'm having trouble with the order of the readme items. We have:
I would move the Archives above the "Working with Shrinkwrap" to explain a basic premise how Shrinkwrap works. Then added sections of "Working with Shrinkwrap", like:
|
a2631ad to
b6278d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xjusko , great work!
https://issues.redhat.com/browse/SHRINKWRAP-535