Actually Yehoshua bar Yosef to the best of my recollection never unequivocably stated that he was God during his lifetime.
He stated thus in John 8:56-59 (it starts with Jesus talking to a group of Jews): “‘Your father Abraham rejoiced that he was to see my day; he saw it and was glad.’ The Jews then said to him, ‘You are not yet fifty years old, and have you seen Abraham?’ Jesus said to them, ‘Truly, truly, I say to you, before Abraham was, I am.’ So they took up stones to throw at him; but Jesus hid himself, and went out of the temple.”
Jesus calls himself “I AM”, which was obviously understood by the Jews as a declaration that He was calling Himself God (why else would they try to stone Him to death, and if He wasn’t saying He was God, why didn’t He clear up that misunderstanding?). There are other instances in the Gospels where Jesus says He is God, but I think this is the best example, both because of His directness and because of the immediate reaction of the Jews towards what He said.
The Romans crucified Yehoshua bar Yosef due to his political influence and their fear of an uprising (some 40 years later a major Jewish uprising did occur - in 3 seperate uprisings between 70c.e.-135 c.e. some one million seven hundred and fifty thousand Jews died in uprisings against the Romans and tens of thousands were sold into slavery). He would not be seen as a “blasphemer” claiming to be God who needed to be eliminated but as a rebel ( King of the Jews not God of the Jews) who could potentially undermine Roman authority.