Skip to content

[SHRINKWRAP-535] Add readme - #168

Merged
petrberan merged 1 commit into
shrinkwrap:mainfrom
xjusko:create-readme
Aug 6, 2024
Merged

petrberan merged 1 commit into
shrinkwrap:mainfrom
xjusko:create-readme

Conversation

@xjusko

@xjusko xjusko commented Jun 21, 2024

Copy link
Copy Markdown
Contributor

Comment thread README.md Resolved
Comment thread README.md Outdated
## Requirements

- **JDK**: Version 8 or newer.
- **Maven**: Version 2.2.0 or newer.

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

Comment thread README.md Resolved
Comment thread 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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still valid @xjusko

Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread README.md
Domain defaultDomain = ShrinkWrap.createDomain();

// Create a domain with a custom configuration builder
Domain domain = ShrinkWrap.createDomain(new ConfigurationBuilder().executorService(service)

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

Comment thread README.md Outdated
// Add content to the archive
customJavaArchive.addClass(MyClass.class);

// Export the archive

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

Comment thread 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
Copy Markdown
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 :)

Comment thread README.md Resolved
Comment thread README.md Resolved
@xjusko
xjusko requested a review from petrberan July 22, 2024 06:45
Comment thread 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread 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
Copy Markdown
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

Comment thread 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
Copy Markdown
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"? :)

Comment thread 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
Copy Markdown
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

Comment thread 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
Copy Markdown
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?

Comment thread 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
Copy Markdown
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
Copy Markdown
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

@petrberan petrberan left a comment

Copy link
Copy Markdown
Member

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