In July, for the first time, a Massachusetts adult will be able to walk into a store and buy marijuana that has been tested for safety and accurately labeled.

That is, if the federal government does not crack down on federal marijuana crimes, if marijuana businesses are able to find banking, and if growers are able to grow enough supply to meet the demand.

This year will mark a major milestone for Massachusetts -- the start of a brand new industry, one that faced enormous opposition and comes with the potential for new benefits and new risks.

Peter Bernard, president of the Massachusetts Grower Advocacy Council, said that from a business perspective, 2017 has been about ramping up. "Everyone is figuring out which ducks they need to put in which order in which row to get themselves ready for 2018," Bernard said.

Recreational marijuana use for adults was legalized on the ballot in November 2016, in spite of concerns about public health and safety and opposition from most of the state's top politicians. The Legislature in 2017 passed a bill making some changes to the law -- increasing the tax rate, pushing the opening of retail shops from January to July 2018, and setting up the process for cities and towns to permanently or temporarily ban marijuana sales.

The new five-member Cannabis Control Commission, which was appointed to set up and then oversee the marijuana industry, started meeting in September and drafted industry regulations in December after a public hearing process.

The rules will be finalized by March 15. The commission will start accepting license applications April 1 and plans to issue the first license June 1.

"Our intent is to have people up and running by July 1 in the adult use part of the business," said Cannabis Control Commission Chairman Steven Hoffman.

Existing medical marijuana dispensaries will have some advantages in entering the recreational market, if they choose to do so, since they already have cultivation facilities up and running. But any company that meets the licensing requirements will be able to grow or sell marijuana this year.

Opening a marijuana shop, however, is far more difficult than opening a drugstore. For example, businesses will have to navigate local ordinances. In addition to the usual zoning and planning requirements, some municipalities have voted to either ban marijuana businesses outright or place a moratorium on marijuana businesses, which can last until the end of 2018. The goal of the moratorium is to give municipalities time to come up with regulations before businesses can open.

Based on rough estimates from groups tracking these moratoriums, approximately 40 communities have banned all marijuana businesses. Around 70 communities have a moratorium.

Amherst failed to pass a moratorium, but did vote to limit the number of retail stores allowed. Springfield is considering a moratorium. Chicopee passed a moratorium. The Holyoke City Council did not establish a moratorium, but instead established zoning rules to regulate where businesses can locate.

Geoff Beckwith, executive director of the Massachusetts Municipal Association, said the Cannabis Control Commission's guidelines have given municipalities a "greater sense of clarity" as cities and towns decide what types of bylaws and regulations they want to pass. Municipalities will now have to act to draft and pass those regulations. For example, towns can limit the number of marijuana businesses or where businesses are sited.

"Things are coming closer into better focus, but there's still a lot of action that dozens and dozens of communities will need to take in terms of passing updated bylaws, ordinances or rules before the licensing process is triggered later this year," Beckwith said.

The Cannabis Control Commission's draft regulations lay out in minute detail the requirements for everything from growing to testing to packaging to selling marijuana.

Although eight states have legalized recreational marijuana use, Massachusetts has a few factors in its laws that are unique.

First, the law requires the state to help communities that have been "disproportionately impacted" by enforcement of marijuana laws. The Cannabis Control Commission defined these areas based on statistics including arrest data, incarceration data, unemployment and income. Marijuana businesses run by people who live in these areas will have lower licensing fees and access to coaching both during the licensing process and during the early stages of their business. State officials are working with the private financial sector and other partners to determine what kinds of opportunities for financing exist for people who are not wealthy but who want to get into the marijuana business.

"We want to get out there and let people know what opportunities are, offer them assistance, and let people understand and successfully navigate the licensing process," Hoffman said. "And if they are successful, give them coaching and guidance and help to help them be successful business people."

Massachusetts also is unique in its development of a social consumption program, which lets businesses allow people to buy and consume marijuana on site - either in a marijuana cafe or as part of a separate business, like a yoga studio or movie theater.

There are also provisions to help small businesses and farmers - for example, tiered licensing with cheaper licenses for smaller growers, or the possibility of co-ops, where groups of growers can join together and apply for a single license.

Massachusetts farmers had some concerns about whether the industry would be welcoming to local agriculture, as opposed to large indoor growing companies.

Sheffield farmer Ted Dobson, who has advocated for the farming community, said the regulations do not exclude farmers but also do not take steps to incentivize local farming. For example, while outdoor growing is allowed, farmers must still pay for expensive cameras and security systems.

"The state isn't saying farmers can't do it, but what they're offering isn't really substantially different in substance from what they are offering the big indoor growers," Dobson said.

The industry will bring in significant new revenue for the state. The Department of Revenue estimates that state tax revenue from marijuana in fiscal 2019 will be between $44 million and $82 million. Marijuana will be taxed with a 6.25 percent sales tax, 10.75 percent excise tax and potentially a 3 percent local option tax, which would go to host communities.

The industry is not expected to be fully ramped up until 2020, given the amount of time it takes to build a marijuana facility, grow the crop and go through the necessary approvals.

Hoffman said even once the industry is fully operational, the oversight commission will continue to look at ways the rules can be updated and improved. "It's not going to be a final product," Hoffman said. "We'll need to see how things evolve and make whatever changes we need to make from a regulatory standpoint."

One major uncertainty is how the federal government will act. Attorney General Jeff Sessions rescinded Obama-era guidelines that prevented the Department of Justice from prosecuting federal marijuana violations when people were complying with state law. Andrew Lelling, the U.S. attorney for Massachusetts, has said he will decide whether to prosecute marijuana crimes on a case-by-case basis.

In addition to making the marijuana business more risky in general, federal uncertainty could also affect what types of banks or credit unions are willing to accept money from the marijuana industry.

The Cannabis Control Commission has said it plans to continue its work despite the federal actions.

One bill introduced in the Statehouse would prohibit state authorities from helping federal law enforcement crack down on state-authorized marijuana commerce. Several bills introduced in Congress would protect state-approved medical and recreational marijuana use from federal intervention.

Will Luzier, a spokesman for the Yes on 4 Coalition, which advocated for legalizing marijuana use, said he thinks Congress and the states may be more interested in protecting marijuana commerce after Sessions' actions.

"Marijuana is a lot more popular than the Trump administration at this point," Luzier said.