The contribution of renewable energy sources to Portugal’s energy generation portfolio is significant and on the path to achieving 100% renewable generation by 2050. Most of the new renewable generation capacity will be procured from distributed photovoltaic (PV) generation installed at buildings. The inherent intermittence of PV output combined with a mismatch with demand profile are challenging the operation and resiliency of the electrical grid. Addressing these issues requires leveraging spatio-temporal flexibility of controllable energy resources such as batteries and Electric Vehicles (EV). This need is recognized by regulators in Portugal and the recent renewable generation self-consumption legislation enables generation-surplus trading in communities. Implementing intra-community trading and utilizing the potentials of renewable generation requires oversight and coordination at the community level in the context of transactive energy systems. This paper focuses on addressing energy sharing through a transactive energy market in community microgrids. The proposed framework considers public and commercial buildings with on-site battery storage and numerous EV charging stations as the main source of flexibility. The formulation is tested using real data from a community of buildings on a Portuguese University campus. The results showcase the achieved increase in renewable self-consumption at building and community levels, as well as the reduction in electricity costs.