Repository navigation
[SHRINKWRAP-535] Add readme - #168
Conversation
| ## Requirements | ||
|
|
||
| - **JDK**: Version 8 or newer. | ||
| - **Maven**: Version 2.2.0 or newer. |
There was a problem hiding this comment.
Just out of curiosity, why 2.2.0?
There was a problem hiding this comment.
That is the minimum version I found in the Maven enforcer plugin.
There was a problem hiding this comment.
Have you tried building it with Maven 2.2.0? I'm curious if it will even work
| 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.
Not sure about the "lives" part. Are there better alternatives? Exists? Is stored? Is Located? Resides? What do you think @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.
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.
I don't think I can write any short example..., but there are more extensive examples in tests.
| // Add content to the archive | ||
| customJavaArchive.addClass(MyClass.class); | ||
|
|
||
| // Export the archive |
There was a problem hiding this comment.
This example is not necessary, we have the one above
| // 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.
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 :)
| 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.
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.
Also the indentation is wrong
There was a problem hiding this comment.
Create a new Java archive (JAR) using ShrinkWrap -> Create a new Java archive (JAR) using ShrinkWrap containing TestClass class and a StringAsset
|
|
||
| ### 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.
on the SHRINKWRAP -> for the SHRINKWRAP
| 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.
What exactly is the difference between "Working with Shrinkwrap" and "Using Shrinkwrap"? :)
| ClassLoader tccl = Thread.currentThread().getContextClassLoader(); | ||
| URL webxml = tccl.getResource("basic.war/web.xml"); | ||
| URL resource = tccl.getResource("basic.war/index.html"); | ||
| if (resource == null) { |
| 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.
Where exactly does the file come from?
| ```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.
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
https://issues.redhat.com/browse/SHRINKWRAP-535