Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@xjusko
Copy link
Contributor

@xjusko xjusko commented Jun 21, 2024

README.md Outdated
## Requirements

- **JDK**: Version 8 or newer.
- **Maven**: Version 2.2.0 or newer.
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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
Copy link
Member

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

Copy link
Member

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)
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Member

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 :)

@xjusko xjusko requested a review from petrberan July 22, 2024 06:45
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.
Copy link
Member

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

Copy link
Member

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

Copy link
Member

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.
Copy link
Member

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
Copy link
Member

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) {
Copy link
Member

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);
Copy link
Member

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");
Copy link
Member

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?

@petrberan
Copy link
Member

I'm having trouble with the order of the readme items. We have:

  • Using Shrinkwrap
    • Working with Shrinkwrap
    • Archives
    • ...

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:

  • Using Shrinkwrap
  • Archives
  • "Working with Shrinkwrap" <- This would need to be renamed
    • JAR
    • WAR
    • EAR
  • ...

@xjusko xjusko force-pushed the create-readme branch 2 times, most recently from a2631ad to b6278d1 Compare August 1, 2024 12:09
Copy link
Member

@petrberan petrberan left a 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!

@petrberan petrberan merged commit 5a5213c into shrinkwrap:main Aug 6, 2024
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.

2 participants