NEW YORK — Attorneys for J.C Penney and Macy were back in court Monday to fight over the Martha Stewart brand after a monthlong mediation period went nowhere.

The court-ordered mediation followed nearly three weeks of testimony from witnesses including the domestic diva herself, Penney CEO Ron Johnson and Macy’s CEO Terry Lundgren.

At issue is whether Macy’s has the exclusive rights to sell some of Martha Stewart branded products such as cookware, bedding and bath products. Macy’s sued Martha Stewart Living, arguing that the company breached its long-standing contract when it signed a deal with Penney in December 2011 to open Martha Stewart mini-shops, planned for this spring. It also sued Penney, contending that it had no regard for the contract and that Johnson had set out to steal the business that Macy’s had worked hard to develop.

The stakes are high for all three companies involved but particularly for Penney, which is counting on a revamped home area this spring to help it rebound from a disastrous year. The company has amassed nearly a $1 billion in losses and saw its revenue drop about 25 percent as the first year of a transformation plan built around a new pricing strategy has failed to resonate with shoppers.

Johnson is counting on the overhauled home department this spring as part of its bigger plan to turn Penney stores into mini-malls of sorts.

It’s in the midst of rolling out 20 shops in its home area featuring products from such designers as Michael Graves and Jonathan Adler. Martha Stewart mini-shops were expected to anchor the home area.

But those plans are in limbo. Penney had ordered goods like towels and cookware from Martha Stewart Living and were planning to name the goods JC Everyday. But Macy’s is trying to stop the retailer from even selling goods covered by Macy’s exclusive category even if they don’t carry the Martha Stewart moniker.

And to make things more complicated for Penney, Macy’s attorneys argued Monday in court that they want to stop Penney from selling plastic tableware like glasses and pitchers that were just starting to be sold on Penney’s website.

Penney planned to sell those items from a mini-shop called Martha Celebrations featuring stationery and other paper products. Such products are not part of Macy’s exclusive contract.

But Theodore M. Grossman, an attorney representing Macy’s, told New York State Supreme Court Justice Jeffrey Oing that the stemware and other tabletop items, even though they’re plastic, sill violate the contract because they compete with the Martha Stewart items that Macy’s sells.

“The basic shapes and designs are the same,” Grossman said. Penney’s attorneys said they needed time to talk to Penney since they were just informed by Macy’s attorneys over the weekend.

Penney is aiming at what it believes is a loophole in the agreement between Macy’s and Martha Stewart. It’s a provision that allows Martha Stewart to sell goods in such categories like bedding in Martha Stewart Living’s own stores. Penney and Martha Stewart have argued that since the Macy’s contract does not specify that the stores have to be stand-alone, the mini-shops within Penney aren’t barred by the exclusivity agreement.

John Tighe, who had been head of Penney’s home area and was a key player in working with Martha Stewart Living in developing the contract, testified Monday that he looked over Macy’s agreement and was confident that Penney could go ahead.Tighe, who now heads up the chain’s men’s area, had met Martha Stewart numerous times to get a sense of what she envisioned for the store.