Context : Aims : We investigate the surroundings of the hypercompact H ii region M 17 UC1 to probe the physical properties of the associated young stellar objects and the environment of massive star formation . Methods : We use diffraction-limited near-IR ( VLT/NACO ) and mid-IR ( VLT/VISIR ) images to reveal the different morphology at various wavelengths . Likewise we investigate the stellar and nebular content of the region by VLT/SINFONI integral field spectroscopy with a resolution R \sim 1500 at H + K bands . Results : Five of the seven point sources in this region show L -band excess emission . Geometric match is found between the H _ { 2 } emission and near-IR polarized light in the vicinity of IRS5A , and between the diffuse mid-IR emission and near-IR polarization north of UC1 . The H _ { 2 } emission is typical for dense PDRs , which are FUV pumped initially and repopulated by collisional de-excitation . The co-presence of He i , H i , and H _ { 2 } lines in most region argues against an edge-on configuration of the M 17 SW PDR , but is in favor of a moderately inclined geometry with respect to the line of sight . The spectral types of IRS5A and B273A are B3 - B7 V/III and G4 - G5 III , respectively . The observed infrared luminosity L _ { \mathrm { IR } } in the range 1 - 20 \mu m is derived for three objects ; we obtain 2.0 \times 10 ^ { 3 } L _ { \sun } for IRS5A , 13 L _ { \sun } for IRS5C , and 10 L _ { \sun } for B273A . Conclusions : IRS5 might be a young quadruple system . Its primary star IRS5A is confirmed to be a high-mass protostellar object ( \sim 9 M _ { \sun } , \sim 1 \times 10 ^ { 5 } \mathrm { yrs } ) ; it might have terminated accretion due to the feedback from the stellar activities ( radiation pressure , outflow ) and the expanding H ii region of M 17 . UC1 might also have terminated accretion because of the expanding hypercompact H ii region ionized by itself . The disk clearing process of the low-mass YSOs in this region might be accelerated by the expanding H ii region . The outflows driven by UC1 are running in south-north with its northeastern side suppressed by the expanding ionization front of M 17 ; the blue-shifted outflow lobe of IRS5A is seen in two types of tracers along the same line of sight in the form of H _ { 2 } emission filament and mid-emission . The H _ { 2 } line ratios probe the properties of M 17 SW PDR , which is confirmed to have a clumpy structure with two temperature distributions : warm , dense molecular clumps with n _ { \mathrm { H } } > 10 ^ { 5 } \mathrm { cm } ^ { -3 } and T \approx 575 K and cooler atomic gas with n _ { \mathrm { H } } \sim 3.7 \times 10 ^ { 3 } -1.5 \times 10 ^ { 4 } \mathrm { cm } ^ { -3 } and T \sim 50 - 200 K .