A hundred-year war with France is finally coming to an end in the isolated village of Lijar in Andalusia. Sunday a representative of the French Embassy will trek through the barren mountains for the official ceremony to end hostilities. The peace treaty will be signed, on the Spanish side, by Socialist Mayor Diego Sanchez Cortes and perhaps by a representative of Spain's royal house.

No prisoners of war will be exchanged. There were never any battles. But Lijar, tucked away in the mountains of Sierra de los Filabres, declared war on France 100 years ago.

The townspeople were so outraged at the snubbing Spanish King Alfonso XII received ''from the miserable crowds belonging to the French nation'' that they rallied to a declaration of war on France.

The handwritten declaration signed by the town councilmen on Oct. 14, 1883, is proudly guarded in Lijar's town hall. But no one ever set out to war, and no French soldiers ever invaded Lijar.

''Don't think we were ever afraid of the French,'' said schoolmaster Ezequiel Campos, with local pride. ''Besides, if they had to do battle with us, they never would have found us.'' Lijar is 53 miles from the provincial capital of Almeria, but the drive along the potholed mountain road takes five hours.

For years Socialist Mayor Diego Sanchez tried to end the hostilities, but the French snubbed his initiatives. Although Spanish-French relations are at an all-time low with the French opposing Spain's Common Market membership, France has decided to sign a peace treaty with Lijar.

An official of the French Embassy in Madrid said smoothly, ''We are pleased that hostilities will come to a formal end soon. The ambassador has ordered the consul general in Malaga, Charles Santi, to be in Lijar for the peace celebration. We are all rather amused.''

But Lijar is taking the matter very seriously. It will hold talks on the political atmosphere in Lijar 100 years ago and on French-Spanish today.